summaryrefslogtreecommitdiff
path: root/plugins/pychrysa
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa')
-rw-r--r--plugins/pychrysa/gui/panels/panel.c7
-rw-r--r--plugins/pychrysa/quirks.c21
-rw-r--r--plugins/pychrysa/quirks.h3
3 files changed, 27 insertions, 4 deletions
diff --git a/plugins/pychrysa/gui/panels/panel.c b/plugins/pychrysa/gui/panels/panel.c
index c35e9a0..b1bcc61 100644
--- a/plugins/pychrysa/gui/panels/panel.c
+++ b/plugins/pychrysa/gui/panels/panel.c
@@ -65,9 +65,7 @@ static PyObject *py_panel_item_new(PyTypeObject *type, PyObject *args, PyObject
int ret; /* Bilan de lecture des args. */
GEditorItem *item; /* Version GLib du format */
- ret = PyArg_ParseTupleAndKeywords(args, kwds, "ssOs",
- (char *[]) { "name", "lname", "widget", "path", NULL },
- &name, &lname, &widget, &path);
+ ret = PyArg_ParseTuple(args, "ssOs", &name, &lname, &widget, &path);
if (!ret) return Py_None;
item = g_panel_item_new(get_internal_ref(), name, lname,
@@ -192,7 +190,8 @@ bool register_python_panel_item(PyObject *module)
.tp_methods = py_panel_item_methods,
.tp_getset = py_panel_item_getseters,
- .tp_new = (newfunc)py_panel_item_new
+ .tp_new = (newfunc)py_panel_item_new,
+ .tp_init = (initproc)pychrysalide_allow_args_for_gobjects
};
diff --git a/plugins/pychrysa/quirks.c b/plugins/pychrysa/quirks.c
index 0e35f57..bd60925 100644
--- a/plugins/pychrysa/quirks.c
+++ b/plugins/pychrysa/quirks.c
@@ -153,6 +153,27 @@ void pychrysalide_set_instance_data(GObject *obj, PyTypeObject *type)
/******************************************************************************
* *
+* Paramètres : self = objet à initialiser (théoriquement). *
+* args = arguments fournis à l'appel. *
+* kwds = arguments de type key=val fournis. *
+* *
+* Description : Initialise un objet dérivé de GObject en Python. *
+* *
+* Retour : 0. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+int pychrysalide_allow_args_for_gobjects(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : ref = espace de référencement global à utiliser. *
* *
* Description : Evite à Python d'avoir à manipuler les références internes. *
diff --git a/plugins/pychrysa/quirks.h b/plugins/pychrysa/quirks.h
index f9c53dc..84a778f 100644
--- a/plugins/pychrysa/quirks.h
+++ b/plugins/pychrysa/quirks.h
@@ -37,6 +37,9 @@ void pychrysalide_init_quirks(void);
/* Crée l'association précise attendue par Python-GObject. */
void pychrysalide_set_instance_data(GObject *, PyTypeObject *);
+/* Initialise un objet dérivé de GObject en Python. */
+int pychrysalide_allow_args_for_gobjects(PyObject *, PyObject *, PyObject *);
+
/* Evite à Python d'avoir à manipuler les références internes. */
GObject *_get_internal_ref(GObject *);