websauna.utils.config.includer module¶
Support for INI file inclusion mechanism.
-
class
websauna.utils.config.includer.
IncludeAwareConfigParser
(filename, *args, **kw)[source]¶ Bases:
paste.deploy.loadwsgi.NicerConfigParser
Include .ini settings file in others.
This is a hack to get quick include support for Pyramid INI settings files. This is a variation of Python
ConfigParser
which knows about[includes]
section. In this section you can tell the config file to include other config files.To add includes add a section in your INI:
[includes] include_ini_files = resource://websauna/conf/production.ini resource://websauna/conf/base.ini
Each included file is referred by URL. Currently support protocols are:
resource:
: This scheme indicates a Python resource specification. The includes are provided as Python packages resources.
The keys in the current INI file sections are added from includes if the keys do not exist yet. Includes are processed from first to last, first taking precedences.
The include is not recursive. E.g. the includes of include are not processed at the moment.
-
optionxform
¶ alias of
builtins.str
-
process_includes
(fpname)[source]¶ Process includes section.
- Parameters
fpname (
str
) – Main configuration filename.
-
read_include
(include_file, fpname)[source]¶ Augment the current config entries from another INI file.