summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/helpers.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-03-04 20:52:50 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-03-04 20:52:50 (GMT)
commit27c21356d494824850005932f3dee5f38d7a8e82 (patch)
tree6d7381f9cde78d28b4664f73ef03d0adb5b7b288 /plugins/pychrysalide/helpers.c
parent72bebbd9dc7d59f69e23442b6c5b5526feb2a1a9 (diff)
Provided access to the graph layout from Python.
Diffstat (limited to 'plugins/pychrysalide/helpers.c')
-rw-r--r--plugins/pychrysalide/helpers.c30
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. *
* *