diff options
Diffstat (limited to 'plugins/pychrysalide/helpers.c')
-rw-r--r-- | plugins/pychrysalide/helpers.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/plugins/pychrysalide/helpers.c b/plugins/pychrysalide/helpers.c index 1e83ac7..e9f65a9 100644 --- a/plugins/pychrysalide/helpers.c +++ b/plugins/pychrysalide/helpers.c @@ -60,7 +60,10 @@ static bool include_python_type_into_features(PyObject *, PyTypeObject *); #define NO_CONSTRUCTOR_MSG _("Chrysalide does not allow building this kind of object from Python") /* Message d'erreur affiché puis recherché. */ -#define NOT_IMPLEMENTED_MSG _("Chrysalide method implementation is missing") +#define NOT_IMPLEMENTED_ROUTINE_MSG _("Chrysalide method implementation is missing") + +/* Message d'erreur affiché puis recherché. */ +#define NOT_IMPLEMENTED_GETTER_MSG _("Chrysalide getter implementation is missing") /* Détermine une documentation adaptée à un type interne. */ @@ -252,7 +255,7 @@ PyObject *run_python_method(PyObject *module, const char *method, PyObject *args if (type != NULL && type == PyExc_NotImplementedError \ && value != NULL && PyUnicode_Check(value)) { - refmsg = PyUnicode_FromString(NOT_IMPLEMENTED_MSG); + refmsg = PyUnicode_FromString(NOT_IMPLEMENTED_ROUTINE_MSG); if (PyUnicode_Compare(value, refmsg) == 0) { @@ -611,7 +614,7 @@ PyObject *not_yet_implemented_method(PyObject *self, PyObject *args) result = NULL; - PyErr_SetString(PyExc_NotImplementedError, NOT_IMPLEMENTED_MSG); + PyErr_SetString(PyExc_NotImplementedError, NOT_IMPLEMENTED_ROUTINE_MSG); return result; @@ -645,6 +648,32 @@ PyObject *py_return_none(PyObject *self, PyObject *args) /****************************************************************************** * * +* Paramètres : self = objet quelconque dont le code Python hérite. * +* closure = non utilisé ici. * +* * +* Description : Marque l'absence d'implémentation pour un attribut donné. * +* * +* Retour : NULL pour la levée d'exception. * +* * +* Remarques : - * +* * +******************************************************************************/ + +PyObject *not_yet_implemented_getter(PyObject *self, void *closure) +{ + PyObject *result; /* Exception à retourner */ + + result = NULL; + + PyErr_SetString(PyExc_NotImplementedError, NOT_IMPLEMENTED_GETTER_MSG); + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : spec = définition à mettre en place dynamiquement. * * * * Description : Définit dans le tas de Python un nouveau type. * |