- Expose the script filename in the Python module environment 'mod_env'

instead of the config_file structure which includes the linked list
  of scripts in a multi Python module setup; fixes #79.
This commit is contained in:
George Thessalonikefs
2023-10-16 15:47:18 +02:00
parent 07149f576a
commit 63a5280f8f
12 changed files with 38 additions and 18 deletions
+8
View File
@@ -952,6 +952,7 @@ struct config_str2list {
/* ************************************************************************************ *
Structure config_file
* ************************************************************************************ */
%ignore config_file::python_script;
struct config_file {
int verbosity;
int stat_interval;
@@ -1035,6 +1036,13 @@ struct config_file {
struct config_strlist* python_script;
};
%extend config_file {
%pythoncode %{
def _deprecated_python_script(self): return "cfg.python_script is deprecated, you can use `mod_env['script']` instead."
python_script = property(_deprecated_python_script)
%}
}
/* ************************************************************************************ *
ASN: Adding structures related to forwards_lookup and dns_cache_find_delegation
* ************************************************************************************ */