Reads the configuration file and imports data. Supported standard types are::
'cfg', 'conf', 'ini',
The imported data for the suported standard syntax is interpreted as:
+----------------------------------------+-------------+-------------------+-------------+-------------------------+----------------------------------------------+
| syntax of imported config | sections as | keys as | path as | insertion position | remark |
+========================================+=============+===================+=============+=========================+==============================================+
| `conf <parser_conf.html>`_ | sections | keys to <section> | -- | top, <section>, DEFAULT | no rename and no nested sections, no globals |
+----------------------------------------+-------------+-------------------+-------------+-------------------------+----------------------------------------------+
| `ini <parser_ini.html>`_ | sections | keys by section | -- | top, <section>, DEFAULT | no rename and no nested sections, no globals |
+----------------------------------------+-------------+-------------------+-------------+-------------------------+----------------------------------------------+
| `inix <parser_inix.html>`_ | sections | keys by section | -- | top, <section>, DEFAULT | no rename and no nested sections, no globals |
+----------------------------------------+-------------+-------------------+-------------+-------------------------+----------------------------------------------+
Args:
conf:
The file path name of the configuration file.
kargs:
Unknown options are passed through to the
configuration parser.
anchor:
The insertion point for the imported data::
anchor := (
<section>
| 'DEFAULT'
| <top>
)
top := "imports valid INIX/INI/CONF files with sections only"
section := "the name of the section"
'DEFAULT' := "keyword defined by the standard library as
global defaults for interpolation"
default := <top>
strict:
Activates validation. The boolean value is
mapped to the corresponding option of the
called import parser:
+------------+----------+-------+--------+
| parser | option | True | False |
+============+==========+=======+========+
| conf | strict | True | False |
+------------+----------+-------+--------+
| ini | strict | True | False |
+------------+----------+-------+--------+
| inix | strict | True | False |
+------------+----------+-------+--------+
syntax:
Force the provided syntax. For available
values refer to syntax multiplexer
*self.synmux*.
Returns:
True for success, else False or raises an exception.
Raises:
pass-through
- Decorators:
|