From: NeilBrown Date: Fri, 25 Dec 2015 22:38:06 +0000 (+1100) Subject: Python: add the new "comm" type to the python namespace X-Git-Tag: lca2016~37 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=b96b3953cf93146b9913f69ab0da63826936d837;p=edlib.git Python: add the new "comm" type to the python namespace also initialise it properly. Signed-off-by: NeilBrown --- diff --git a/lang-python.c b/lang-python.c index 7935cfcb..d167bfc4 100644 --- a/lang-python.c +++ b/lang-python.c @@ -982,10 +982,13 @@ void edlib_init(struct editor *ed) PaneType.tp_new = PyType_GenericNew; MarkType.tp_new = PyType_GenericNew; + CommType.tp_new = PyType_GenericNew; if (PyType_Ready(&PaneType) < 0) return; if (PyType_Ready(&MarkType) < 0) return; + if (PyType_Ready(&CommType) < 0) + return; m = Py_InitModule3("edlib", NULL, "edlib - one more editor is never enough."); @@ -997,6 +1000,7 @@ void edlib_init(struct editor *ed) Py_INCREF(&MarkType); PyModule_AddObject(m, "pane", (PyObject *)&PaneType); PyModule_AddObject(m, "mark", (PyObject *)&MarkType); + PyModule_AddObject(m, "comm", (PyObject *)&CommType); key_add(ed->commands, "python-load", &python_load); Edlib_CommandFailed = PyErr_NewException("edlib.commandfailed", NULL, NULL);