diff options
Diffstat (limited to 'plugins/pychrysa/helpers.c')
-rw-r--r-- | plugins/pychrysa/helpers.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/pychrysa/helpers.c b/plugins/pychrysa/helpers.c index d344a7f..5ba2fb4 100644 --- a/plugins/pychrysa/helpers.c +++ b/plugins/pychrysa/helpers.c @@ -27,6 +27,36 @@ /****************************************************************************** * * +* Paramètres : target = propriétaire de la routine visée. * +* method = désignation de la fonction à appeler. * +* * +* Description : Indique si une routine Python existe ou non. * +* * +* Retour : Bilan de l'analyse. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool has_python_method(PyObject *module, const char *method) +{ + bool result; /* Bilan à retourner */ + PyObject *func; /* Fonction visée */ + + func = PyObject_GetAttrString(module, method); + if (func == NULL) return false; + + result = PyCallable_Check(func); + + Py_DECREF(func); + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : func = fonction Python à appeler. * * args = arguments à associer à l'opération. * * * |