diff options
Diffstat (limited to 'lib/base/console.cpp')
| -rw-r--r-- | lib/base/console.cpp | 154 |
1 files changed, 0 insertions, 154 deletions
diff --git a/lib/base/console.cpp b/lib/base/console.cpp index 9204bcca..830855fc 100644 --- a/lib/base/console.cpp +++ b/lib/base/console.cpp @@ -333,152 +333,6 @@ struct eConsolePy PyObject *in_weakreflist; /* List of weak references */ }; -#define COMPATIBILITY_MODE -// with COMPATIBILITY_MODE enabled the callback list is accessed via console.appClosed.get() -// we remove this code after next enigma2 release... then the list should be accessed via console.appClosed ( without .get() ) - -#ifdef COMPATIBILITY_MODE -struct eListCompatibilityWrapper -{ - PyObject_HEAD - PyObject *list; - PyObject *in_weakreflist; /* List of weak references */ -}; - -static int -eListCompatibilityWrapper_traverse(eListCompatibilityWrapper *self, visitproc visit, void *arg) -{ - Py_VISIT(self->list); - return 0; -} - -static int -eListCompatibilityWrapper_clear(eListCompatibilityWrapper *self) -{ - Py_CLEAR(self->list); - return 0; -} - -static void -eListCompatibilityWrapper_dealloc(eListCompatibilityWrapper* self) -{ - if (self->in_weakreflist != NULL) - PyObject_ClearWeakRefs((PyObject *) self); - eListCompatibilityWrapper_clear(self); - Org_Py_DECREF(self->list); - self->ob_type->tp_free((PyObject*)self); -} - -static PyObject * -eListCompatibilityWrapper_get(eListCompatibilityWrapper *self, void *closure) -{ - Org_Py_INCREF(self->list); - return self->list; -} - -static PyMethodDef eListCompatibilityWrapper_methods[] = { - {"get", (PyCFunction)eListCompatibilityWrapper_get, METH_NOARGS, - "returns the list" - }, - {NULL} /* Sentinel */ -}; - -static PyGetSetDef eListCompatibilityWrapper_getseters[] = { - {NULL} /* Sentinel */ -}; - -static PyTypeObject eListCompatibilityWrapperType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "eConsoleImpl.eListCompatibilityWrapper", /*tp_name*/ - sizeof(eListCompatibilityWrapper), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)eListCompatibilityWrapper_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "eListCompatibilityWrapper objects", /* tp_doc */ - (traverseproc)eListCompatibilityWrapper_traverse, /* tp_traverse */ - (inquiry)eListCompatibilityWrapper_clear, /* tp_clear */ - 0, /* tp_richcompare */ - offsetof(eListCompatibilityWrapper, in_weakreflist), /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - eListCompatibilityWrapper_methods, /* tp_methods */ - 0, /* tp_members */ - eListCompatibilityWrapper_getseters, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ -}; - -static PyObject * -eConsolePy_dataAvail(eConsolePy *self, void *closure) -{ - eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0); - Org_Py_INCREF((PyObject*)wrapper); - wrapper->list = self->cont->dataAvail.get(); - wrapper->in_weakreflist = NULL; - return (PyObject*)wrapper; -} - -static PyObject * -eConsolePy_stdoutAvail(eConsolePy *self, void *closure) -{ - eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0); - Org_Py_INCREF((PyObject*)wrapper); - wrapper->list = self->cont->stdoutAvail.get(); - wrapper->in_weakreflist = NULL; - return (PyObject*)wrapper; -} - -static PyObject * -eConsolePy_stderrAvail(eConsolePy *self, void *closure) -{ - eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0); - Org_Py_INCREF((PyObject*)wrapper); - wrapper->list = self->cont->stderrAvail.get(); - wrapper->in_weakreflist = NULL; - return (PyObject*)wrapper; -} - -static PyObject * -eConsolePy_dataSent(eConsolePy *self, void *closure) -{ - eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0); - Org_Py_INCREF((PyObject*)wrapper); - wrapper->list = self->cont->dataSent.get(); - wrapper->in_weakreflist = NULL; - return (PyObject*)wrapper; -} - -static PyObject * -eConsolePy_appClosed(eConsolePy *self, void *closure) -{ - eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0); - Org_Py_INCREF((PyObject*)wrapper); - wrapper->list = self->cont->appClosed.get(); - wrapper->in_weakreflist = NULL; - return (PyObject*)wrapper; -} -#else static PyObject * eConsolePy_dataAvail(eConsolePy *self, void *closure) { @@ -508,7 +362,6 @@ eConsolePy_appClosed(eConsolePy *self, void *closure) { return self->cont->appClosed.get(); } -#endif static PyGetSetDef eConsolePy_getseters[] = { {"dataAvail", @@ -828,13 +681,6 @@ void eConsoleInit(void) if (m == NULL) return; -#ifdef COMPATIBILITY_MODE - if (!PyType_Ready(&eListCompatibilityWrapperType)) - { - Org_Py_INCREF((PyObject*)&eListCompatibilityWrapperType); - PyModule_AddObject(m, "eListCompatibilityWrapper", (PyObject*)&eListCompatibilityWrapperType); - } -#endif if (!PyType_Ready(&eConsolePyType)) { Org_Py_INCREF((PyObject*)&eConsolePyType); |
