summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/core/global.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/core/global.c')
-rw-r--r--plugins/pychrysalide/core/global.c62
1 files changed, 45 insertions, 17 deletions
diff --git a/plugins/pychrysalide/core/global.c b/plugins/pychrysalide/core/global.c
index 86133d2..ff892a8 100644
--- a/plugins/pychrysalide/core/global.c
+++ b/plugins/pychrysalide/core/global.c
@@ -107,6 +107,16 @@ static PyObject *py_global_get_content_explorer(PyObject *self, PyObject *args)
PyObject *result; /* Instance Python à retourner */
GContentExplorer *explorer; /* Gestionnaire natif récupéré */
+#define GLOBAL_GET_CONTENT_EXPLORER_METHOD PYTHON_METHOD_DEF \
+( \
+ get_content_explorer, "", \
+ METH_NOARGS, py_global, \
+ "Get the global exploration manager discovering contents." \
+ "\n" \
+ "The returned object is a pychrysalide.analysis.ContentExplorer" \
+ " instance used as singleton." \
+)
+
explorer = get_current_content_explorer();
if (explorer != NULL)
@@ -143,6 +153,17 @@ static PyObject *py_global_get_content_resolver(PyObject *self, PyObject *args)
PyObject *result; /* Instance Python à retourner */
GContentResolver *resolver; /* Gestionnaire natif récupéré */
+#define GLOBAL_GET_CONTENT_RESOLVER_METHOD PYTHON_METHOD_DEF \
+( \
+ get_content_resolver, "", \
+ METH_NOARGS, py_global, \
+ "Get the global resolution manager translating binary contents" \
+ " into loaded contents." \
+ "\n" \
+ "The returned object is a pychrysalide.analysis.ContentResolver" \
+ " instance used as singleton." \
+)
+
resolver = get_current_content_resolver();
if (resolver != NULL)
@@ -179,6 +200,16 @@ static PyObject *py_global_get_current_project(PyObject *self, PyObject *args)
PyObject *result; /* Instance Python à retourner */
GStudyProject *project; /* Projet courant récupéré */
+#define GLOBAL_GET_CURRENT_PROJECT_METHOD PYTHON_METHOD_DEF \
+( \
+ get_current_project, "", \
+ METH_NOARGS, py_global, \
+ "Get the current global project." \
+ "\n" \
+ "The returned object is an instance of type" \
+ " pychrysalide.analysis.StudyProject." \
+)
+
project = get_current_project();
if (project != NULL)
@@ -215,6 +246,16 @@ static PyObject *py_global_set_current_project(PyObject *self, PyObject *args)
GStudyProject *project; /* Version GLib du projet */
int ret; /* Bilan de lecture des args. */
+#define GLOBAL_SET_CURRENT_PROJECT_METHOD PYTHON_METHOD_DEF \
+( \
+ set_current_project, "project", \
+ METH_VARARGS, py_global, \
+ "Set the current global project." \
+ "\n" \
+ "The provided project has to be an instance (or a subclass)" \
+ " of pychrysalide.analysis.StudyProject." \
+)
+
ret = PyArg_ParseTuple(args, "O&", convert_to_study_project, &project);
if (!ret) return NULL;
@@ -246,24 +287,11 @@ bool populate_core_module_with_global(void)
static PyMethodDef py_global_methods[] = {
GLOBAL_IS_BATCH_MODE_METHOD,
- { "get_content_explorer", py_global_get_content_explorer,
- METH_NOARGS,
- "get_content_explorer(, /)\n--\n\nGet the global exploration manager discovering contents."
- },
- { "get_content_resolver", py_global_get_content_resolver,
- METH_NOARGS,
- "get_content_resolver(, /)\n--\n\nGet the global resolution manager translating binary contents into loaded contents."
- },
- { "get_current_project", py_global_get_current_project,
- METH_NOARGS,
- "get_current_project(, /)\n--\n\nGet the current global project."
- },
- { "set_current_project", py_global_set_current_project,
- METH_VARARGS,
- "set_current_project(, /)\n--\n\nSet the current global project."
- },
+ GLOBAL_GET_CONTENT_EXPLORER_METHOD,
+ GLOBAL_GET_CONTENT_RESOLVER_METHOD,
+ GLOBAL_GET_CURRENT_PROJECT_METHOD,
+ GLOBAL_SET_CURRENT_PROJECT_METHOD,
{ NULL }
-
};
module = get_access_to_python_module("pychrysalide.core");