diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2022-02-21 06:54:10 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2022-02-21 06:54:10 (GMT) | 
| commit | 8bf77ba6e5ef40d8bb936dc952ac2c8cc30aab3e (patch) | |
| tree | 934661f2f30e0b8d23793f52084c736052e85f7c /plugins/pychrysalide | |
| parent | 8ce244d136b32b43d8553866747c68b503b2d10a (diff) | |
Make the server drive the network exchanges.
Diffstat (limited to 'plugins/pychrysalide')
| -rw-r--r-- | plugins/pychrysalide/analysis/db/analyst.c | 4 | ||||
| -rw-r--r-- | plugins/pychrysalide/analysis/db/constants.c | 43 | ||||
| -rw-r--r-- | plugins/pychrysalide/analysis/db/constants.h | 3 | 
3 files changed, 50 insertions, 0 deletions
| diff --git a/plugins/pychrysalide/analysis/db/analyst.c b/plugins/pychrysalide/analysis/db/analyst.c index 289db31..c55f34a 100644 --- a/plugins/pychrysalide/analysis/db/analyst.c +++ b/plugins/pychrysalide/analysis/db/analyst.c @@ -36,6 +36,7 @@  #include "client.h"  #include "collection.h" +#include "constants.h"  #include "../content.h"  #include "../loaded.h"  #include "../../access.h" @@ -901,6 +902,9 @@ bool ensure_python_analyst_client_is_registered(void)          if (!register_class_for_pygobject(dict, G_TYPE_ANALYST_CLIENT, type, get_python_hub_client_type()))              return false; +        if (!define_loading_status_hint_constants(type)) +            return false; +      }      return true; diff --git a/plugins/pychrysalide/analysis/db/constants.c b/plugins/pychrysalide/analysis/db/constants.c index 8e7765a..5e8c20d 100644 --- a/plugins/pychrysalide/analysis/db/constants.c +++ b/plugins/pychrysalide/analysis/db/constants.c @@ -25,6 +25,7 @@  #include "constants.h" +#include <analysis/db/analyst.h>  #include <analysis/db/item.h>  #include <analysis/db/server.h> @@ -152,3 +153,45 @@ bool define_hub_server_constants(PyTypeObject *type)      return result;  } + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : type = type dont le dictionnaire est à compléter.            * +*                                                                             * +*  Description : Définit les constantes pour les indications de chargement.   * +*                                                                             * +*  Retour      : true en cas de succès de l'opération, false sinon.           * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +bool define_loading_status_hint_constants(PyTypeObject *type) +{ +    bool result;                            /* Bilan à retourner           */ +    PyObject *values;                       /* Groupe de valeurs à établir */ + +    values = PyDict_New(); + +    result = add_const_to_group(values, "READY", LSH_READY); +    if (result) result = add_const_to_group(values, "ON_WAIT_LIST", LSH_ON_WAIT_LIST); +    if (result) result = add_const_to_group(values, "NEED_CONTENT", LSH_NEED_CONTENT); +    if (result) result = add_const_to_group(values, "NEED_FORMAT", LSH_NEED_FORMAT); +    if (result) result = add_const_to_group(values, "NEED_ARCH", LSH_NEED_ARCH); + +    if (!result) +    { +        Py_DECREF(values); +        goto exit; +    } + +    result = attach_constants_group_to_type_with_pyg_enum(type, false, "LoadingStatusHint", values, +                                                          "Indication about a loading process state.", +                                                          G_TYPE_LOADING_STATUS_HINT); + + exit: + +    return result; + +} diff --git a/plugins/pychrysalide/analysis/db/constants.h b/plugins/pychrysalide/analysis/db/constants.h index 5f0afeb..ea7a0c0 100644 --- a/plugins/pychrysalide/analysis/db/constants.h +++ b/plugins/pychrysalide/analysis/db/constants.h @@ -39,6 +39,9 @@ bool define_db_item_constants(PyTypeObject *);  /* Définit les constantes pour les serveurs de données. */  bool define_hub_server_constants(PyTypeObject *); +/* Définit les constantes pour les indications de chargement. */ +bool define_loading_status_hint_constants(PyTypeObject *); +  #endif  /* _PLUGINS_PYCHRYSALIDE_ANALYSIS_DB_CONSTANTS_H */ | 
