Module: config.py
- Purpose:
This module provides the functionality for reading and importing the
config.tomlfile to the project.- Platform:
Linux/Windows | Python 3.10+
- Developer:
J Berendt
- Email:
- Comments:
If the version of Python is 3.11+, the
tomllibbuiltin is used to load the config file. Otherwise, the third-partytomllibrary is used. Iftomlis not installed, the user is notified the library must be installed, and the program is exited.- Example:
Example code use:
>>> from badsnakes.libs.config import (analysercfg, config, systemcfg)
- class badsnakes.libs.config.Config[source]
Bases:
objectGeneral project configuration wrapper class.
Note
This class is used to simply read and provide access to the settings defined in the
config.tomlfile.All configuration keys are to be set in the
config.tomlfile, not in this module.- property analyserconfig
Public accessor to the analyser’s configuration items.
- property config
Public accessor to all configuration items.
- property dir_root
Public accessor to the project’s root directory.
- property projectconfig
Public accessor to project configuration items.
- property systemconfig
Public accessor to system configuration items.