]> git.neil.brown.name Git - edlib.git/commitdiff
Python: add the new "comm" type to the python namespace
authorNeilBrown <neil@brown.name>
Fri, 25 Dec 2015 22:38:06 +0000 (09:38 +1100)
committerNeilBrown <neil@brown.name>
Fri, 25 Dec 2015 22:41:05 +0000 (09:41 +1100)
also initialise it properly.

Signed-off-by: NeilBrown <neil@brown.name>
lang-python.c

index 7935cfcbd87114e89ed4fbbfbcad379dc889ef3d..d167bfc4d58c977afb06653af122a09ecce7561f 100644 (file)
@@ -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);