mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-08-30 11:49:54 +02:00
- 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:
@@ -1,9 +1,9 @@
|
||||
def init(id, cfg):
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, cfg.port, cfg.python_script))
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, cfg.port, mod_env['script']))
|
||||
return True
|
||||
|
||||
def init_standard(id, env):
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, env.cfg.port, env.cfg.python_script))
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, env.cfg.port, mod_env['script']))
|
||||
return True
|
||||
|
||||
def deinit(id):
|
||||
|
||||
@@ -50,7 +50,7 @@ Script file must contain four compulsory functions:
|
||||
::
|
||||
|
||||
def init(id, cfg):
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, cfg.port, cfg.python_script))
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, cfg.port, mod_env['script']))
|
||||
return True
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ Script file must contain four compulsory functions:
|
||||
::
|
||||
|
||||
def init_standard(id, env):
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, env.cfg.port, env.cfg.python_script))
|
||||
log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, env.cfg.port, mod_env['script']))
|
||||
return True
|
||||
|
||||
|
||||
|
||||
@@ -339,4 +339,5 @@ config_file
|
||||
|
||||
.. attribute:: python_script
|
||||
|
||||
Python script file.
|
||||
Linked list of Python script files.
|
||||
Deprecated; `mod_env['script']` should be used instead.
|
||||
|
||||
@@ -6,8 +6,11 @@ Global variables
|
||||
|
||||
.. envvar:: mod_env
|
||||
|
||||
Module environment, contains data pointer for module-specific data.
|
||||
See :class:`pythonmod_env`.
|
||||
Module environment, it is the 'data' pointer for module-specific data
|
||||
in :class:`pythonmod_env`.
|
||||
It is initialized as a dictionary with the 'script' key pointing to the
|
||||
module's python script.
|
||||
It can be further populated during runtime for module-specific data.
|
||||
|
||||
|
||||
Predefined constants
|
||||
|
||||
Reference in New Issue
Block a user