diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2013-01-26 19:41:04 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2013-01-26 19:41:04 (GMT) |
commit | 2050b07c42c15738662dd9b3c5841694b64ab2a3 (patch) | |
tree | f6283df4b4775f0c4e42e14025d67443f8fdf9b5 /plugins/pychrysa/format/dex | |
parent | b0b35292cb22899b1b23556be452eb827e4010d7 (diff) |
Provided some debug helpers as plugin samples.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@330 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pychrysa/format/dex')
-rw-r--r-- | plugins/pychrysa/format/dex/dex.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/pychrysa/format/dex/dex.c b/plugins/pychrysa/format/dex/dex.c index cae87f7..3e2746e 100644 --- a/plugins/pychrysa/format/dex/dex.c +++ b/plugins/pychrysa/format/dex/dex.c @@ -168,7 +168,7 @@ static PyObject *py_dex_format_get_class(PyObject *self, PyObject *args) bool register_python_dex_format(PyObject *module) { - PyObject *pygobj_mod; /* Module Python-GObject */ + PyObject *parent_mod; /* Accès au module parent */ int ret; /* Bilan d'un appel */ static PyMethodDef py_dex_format_methods[] = { @@ -206,11 +206,11 @@ bool register_python_dex_format(PyObject *module) }; - pygobj_mod = PyImport_ImportModule("pychrysalide.format"); - if (pygobj_mod == NULL) return false; + parent_mod = PyImport_ImportModule("pychrysalide.format"); + if (parent_mod == NULL) return false; - py_dex_format_type.tp_base = (PyTypeObject *)PyObject_GetAttrString(pygobj_mod, "BinFormat"); - Py_DECREF(pygobj_mod); + py_dex_format_type.tp_base = (PyTypeObject *)PyObject_GetAttrString(parent_mod, "ExeFormat"); + Py_DECREF(parent_mod); if (PyType_Ready(&py_dex_format_type) < 0) return false; @@ -218,8 +218,14 @@ bool register_python_dex_format(PyObject *module) Py_INCREF(&py_dex_format_type); ret = PyModule_AddObject(module, "DexFormat", (PyObject *)&py_dex_format_type); + parent_mod = PyImport_ImportModule("pychrysalide.format"); + if (parent_mod == NULL) return false; + pygobject_register_class(module, "GDexFormat", G_TYPE_DEX_FORMAT, &py_dex_format_type, - Py_BuildValue("(O)", py_dex_format_type.tp_base)); + Py_BuildValue("(OO)", py_dex_format_type.tp_base, + PyObject_GetAttrString(parent_mod, "BinFormat"))); + + Py_DECREF(parent_mod); return (ret == 0); |