configparser
Base module for pyRevit config parsing.
Attributes
KEY_VALUE_TRUE = 'True'
module-attribute
KEY_VALUE_FALSE = 'False'
module-attribute
Classes
PyRevitConfigSectionParser(config_parser, section_name)
Bases: object
Config section parser object. Handle section options.
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
Attributes
header
property
Section header.
subheader
property
Section sub-header e.g. Section.SubSection.
Functions
has_option(option_name)
get_option(op_name, default_value=None)
Get option value or return default.
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
set_option(op_name, value)
remove_option(option_name)
has_subsection(section_name)
add_subsection(section_name)
get_subsections()
Get all subsections.
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
get_subsection(section_name)
PyRevitConfigParser(cfg_file_path=None)
Bases: object
Config parser object. Handle config sections and io.
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
Functions
get_config_file_hash()
Get calculated unique hash for this config.
Returns:
Type | Description |
---|---|
str
|
hash of the config. |
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
has_section(section_name)
add_section(section_name)
get_section(section_name)
Get section with given name.
Raises:
Type | Description |
---|---|
AttributeError
|
if section is missing |
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
remove_section(section_name)
Remove section from config.
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
reload(cfg_file_path=None)
Reload config from original or given file.
Source code in pyrevitlib/pyrevit/coreutils/configparser.py
save(cfg_file_path=None)
Save config to original or given file.