diff options
Diffstat (limited to 'plugins/pychrysalide/helpers.c')
-rw-r--r-- | plugins/pychrysalide/helpers.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/pychrysalide/helpers.c b/plugins/pychrysalide/helpers.c index 48b805c..674221b 100644 --- a/plugins/pychrysalide/helpers.c +++ b/plugins/pychrysalide/helpers.c @@ -52,6 +52,9 @@ static bool include_python_type_into_features(PyObject *, PyTypeObject *); /* --------------------------- CONFORTS CIBLANT PYGOBJECT --------------------------- */ +/* Message d'erreur affiché. */ +#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") @@ -548,6 +551,33 @@ bool register_python_module_object(PyObject *module, PyTypeObject *type) /****************************************************************************** * * +* Paramètres : type = type du nouvel objet à mettre en place. * +* args = éventuelle liste d'arguments. * +* kwds = éventuel dictionnaire de valeurs mises à disposition. * +* * +* Description : Marque l'interdiction d'une instanciation depuis Python. * +* * +* Retour : NULL pour la levée d'exception. * +* * +* Remarques : - * +* * +******************************************************************************/ + +PyObject *no_python_constructor_allowed(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyObject *result; /* Exception à retourner */ + + result = NULL; + + PyErr_SetString(PyExc_NotImplementedError, NO_CONSTRUCTOR_MSG); + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : self = objet quelconque dont le code Python hérite. * * args = série d'arguments si présents. * * * |