__init__(self,
filename,
additional_content=[],
new_content=[],
show_error=False)
(Constructor)
Config constructor. It reads a set of attributes in a configuration
file.
-
- Parameters:
filename -
The name of the configuration file.
(type=string)
additional_content -
Description of attributes (in addition to the default
attributes) read in the configuration file. There are three or
four elements in each tuple:
-
the field name or section name (in case a whole section is
put in the attribute), to be read in the configuration
file;
-
the section name (in which the field lies), discarded in
case a whole section is read;
-
the name of the attribute, optional (default: the field
name);
-
the type of the attribute: 'Int', 'IntList', 'IntSection',
'Bool', 'Float', 'FloatList', 'FloatSection', 'String',
'StringList, 'StringSection', 'Num, 'NumList' or
'NumSection', where 'Num' means 'Int' or 'Float', and
'Section' means that a whole section is read and returned in
a list made of the section lines.
(type=list of tuples of strings)
new_content -
Description of all attributes. It overwrites the default
attributes.
(type=list of tuples of strings)
show_error -
True if an exception may be launched when an error occurs,
False otherwise.
(type=Boolean)
|