diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2023-11-13 19:44:16 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2023-11-13 19:44:16 +0000 |
| commit | 16fd0b24910488e59ca1941387b9ac7fb646a837 (patch) | |
| tree | 2cec66ecd6a6986811db8d82dc14d2c054e37e49 /pythonmod/doc | |
| parent | 292d51198aa319c58f534549851e9c28486abdf4 (diff) | |
Diffstat (limited to 'pythonmod/doc')
| -rw-r--r-- | pythonmod/doc/examples/example0-1.py | 4 | ||||
| -rw-r--r-- | pythonmod/doc/examples/example0.rst | 4 | ||||
| -rw-r--r-- | pythonmod/doc/modules/config.rst | 7 | ||||
| -rw-r--r-- | pythonmod/doc/modules/env.rst | 7 |
4 files changed, 13 insertions, 9 deletions
diff --git a/pythonmod/doc/examples/example0-1.py b/pythonmod/doc/examples/example0-1.py index 7904f73a55e8..506235eb4205 100644 --- a/pythonmod/doc/examples/example0-1.py +++ b/pythonmod/doc/examples/example0-1.py @@ -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): diff --git a/pythonmod/doc/examples/example0.rst b/pythonmod/doc/examples/example0.rst index 693972a141a4..cee551de0259 100644 --- a/pythonmod/doc/examples/example0.rst +++ b/pythonmod/doc/examples/example0.rst @@ -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 diff --git a/pythonmod/doc/modules/config.rst b/pythonmod/doc/modules/config.rst index 89afbef8ac2c..ac4db4c94af2 100644 --- a/pythonmod/doc/modules/config.rst +++ b/pythonmod/doc/modules/config.rst @@ -129,7 +129,7 @@ config_file .. attribute:: ifs - Interface description strings (IP addresses). + List of interface description strings (IP addresses). .. attribute:: num_out_ifs @@ -138,7 +138,7 @@ config_file .. attribute:: out_ifs - Outgoing interface description strings (IP addresses). + List of outgoing interface description strings (IP addresses). .. attribute:: root_hints @@ -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. diff --git a/pythonmod/doc/modules/env.rst b/pythonmod/doc/modules/env.rst index eae4c73c7cfd..be5c3b1dbe6c 100644 --- a/pythonmod/doc/modules/env.rst +++ b/pythonmod/doc/modules/env.rst @@ -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 |
