diff options
Diffstat (limited to 'plugins/dex/python/field.c')
-rw-r--r-- | plugins/dex/python/field.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/plugins/dex/python/field.c b/plugins/dex/python/field.c index 69faccc..1381af6 100644 --- a/plugins/dex/python/field.c +++ b/plugins/dex/python/field.c @@ -36,6 +36,10 @@ +#define DEX_FIELD_DOC \ + "The DexField object handles a field linked to a DEX class." + + /* Fournit les indications Dex concernant le champ de classe. */ static PyObject *py_dex_field_get_encoded(PyObject *, void *); @@ -63,6 +67,12 @@ static PyObject *py_dex_field_get_encoded(PyObject *self, void *closure) GDexField *field; /* Version native */ const encoded_field *info; /* Elément à traiter */ +#define DEX_FIELD_ENCODED_ATTRIB PYTHON_GET_DEF_FULL \ +( \ + encoded, py_dex_field, \ + "Encoded information about the Dex field." \ +) + field = G_DEX_FIELD(pygobject_get(self)); info = g_dex_field_get_dex_info(field); @@ -93,6 +103,12 @@ static PyObject *py_dex_field_get_variable(PyObject *self, void *closure) GDexField *field; /* Version native */ GBinVariable *variable; /* Variable correspondante */ +#define DEX_FIELD_VARIABLE_ATTRIB PYTHON_GET_DEF_FULL \ +( \ + variable, py_dex_field, \ + "Chrysalide variable for the Dex field." \ +) + field = G_DEX_FIELD(pygobject_get(self)); variable = g_dex_field_get_variable(field); @@ -125,14 +141,8 @@ PyTypeObject *get_python_dex_field_type(void) }; static PyGetSetDef py_dex_field_getseters[] = { - { - "encoded", py_dex_field_get_encoded, NULL, - "Encoded information about the Dex field.", NULL - }, - { - "variable", py_dex_field_get_variable, NULL, - "Chrysalide variable for the Dex field.", NULL - }, + DEX_FIELD_ENCODED_ATTRIB, + DEX_FIELD_VARIABLE_ATTRIB, { NULL } }; @@ -145,7 +155,7 @@ PyTypeObject *get_python_dex_field_type(void) .tp_flags = Py_TPFLAGS_DEFAULT, - .tp_doc = "PyChrysalide Dex class field.", + .tp_doc = DEX_FIELD_DOC, .tp_methods = py_dex_field_methods, .tp_getset = py_dex_field_getseters |