pyrevit.coreutils.configparser

Base module for pyRevit config parsing.

class pyrevit.coreutils.configparser.PyRevitConfigParser(cfg_file_path=None)

Bases: object

Config parser object. Handle config sections and io.

add_section(section_name)

Add section with given name to config.

get_config_file_hash()

Get calculated unique hash for this config.

get_section(section_name)

Get section with given name.

Raises:AttributeError – if section is missing
has_section(section_name)

Check if config contains given section.

reload(cfg_file_path=None)

Reload config from original or given file.

remove_section(section_name)

Remove section from config.

save(cfg_file_path=None)

Save config to original or given file.

class pyrevit.coreutils.configparser.PyRevitConfigSectionParser(config_parser, section_name)

Bases: object

Config section parser object. Handle section options.

add_subsection(section_name)

Add subsection to section.

get_option(op_name, default_value=None)

Get option value or return default.

get_subsection(section_name)

Get subsection with given name.

get_subsections()

Get all subsections.

has_option(option_name)

Check if section contains given option.

has_subsection(section_name)

Check if section has any subsections.

header

Section header.

remove_option(option_name)

Remove given option from section.

set_option(op_name, value)

Set value of given option.

subheader

Section sub-header e.g. Section.SubSection