Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Public Member Functions | |
def | __init__ (self, parent=None) |
def | add_default (self, key, template_keys=None) |
def | add_include (self, filename, parser=None) |
def | add_section (self, key, template_keys=None, mdicts=None) |
def | default (self, key) |
def | defaults (self) |
def | find_value (self, sections, key) |
def | get (self, section, key) |
def | get_defaults (self, key) |
def | get_sections (self, key, attr='_sections', searched=None) |
def | includes (self) |
def | multi_get (self, section, key_list) |
def | read (self, filename, sect=None) |
def | section (self, key) |
def | sections (self) |
def | set (self, section, key, val) |
def | write (self, config_file) |
Definition at line 323 of file astconfigparser.py.
def __init__ | ( | self, | |
parent = None |
|||
) |
Reimplemented in SqlConfigParser.
Definition at line 324 of file astconfigparser.py.
References Section._defaults, MultiOrderedConfigParser._defaults, MultiOrderedConfigParser._includes, MultiOrderedConfigParser._parent, and MultiOrderedConfigParser._sections.
def add_default | ( | self, | |
key, | |||
template_keys = None |
|||
) |
Adds a default section to defaults, returning the default Section object.
Definition at line 359 of file astconfigparser.py.
References Section._defaults, MultiOrderedConfigParser._defaults, and MultiOrderedConfigParser.add_section().
Referenced by MultiOrderedConfigParser.read().
def add_include | ( | self, | |
filename, | |||
parser = None |
|||
) |
Add a new #include file to the configuration.
Definition at line 422 of file astconfigparser.py.
References MultiOrderedConfigParser._includes.
Referenced by MultiOrderedConfigParser.read().
def add_section | ( | self, | |
key, | |||
template_keys = None , |
|||
mdicts = None |
|||
) |
Create a new section in the configuration. The name of the new section is the 'key' parameter.
Definition at line 403 of file astconfigparser.py.
References MultiOrderedConfigParser._sections, and MultiOrderedConfigParser.get_defaults().
Referenced by MultiOrderedConfigParser.add_default(), MultiOrderedConfigParser.read(), and SqlConfigParser.read().
def default | ( | self, | |
key | |||
) |
Retrieves a list of dictionaries for a default section.
Definition at line 355 of file astconfigparser.py.
References MultiOrderedConfigParser.get_defaults().
Referenced by MultiOrderedConfigParser.get().
def defaults | ( | self | ) |
Definition at line 352 of file astconfigparser.py.
References Section._defaults, and MultiOrderedConfigParser._defaults.
Referenced by MultiOrderedConfigParser.set().
def find_value | ( | self, | |
sections, | |||
key | |||
) |
Given a list of sections, try to find value(s) for the given key.
Definition at line 330 of file astconfigparser.py.
Referenced by MultiOrderedConfigParser.get().
def get | ( | self, | |
section, | |||
key | |||
) |
Retrieves the list of values from a section for a key.
Definition at line 433 of file astconfigparser.py.
References MultiOrderedConfigParser.default(), MultiOrderedConfigParser.find_value(), and MultiOrderedConfigParser.section().
Referenced by Section.__getitem__(), and MultiOrderedConfigParser.multi_get().
def get_defaults | ( | self, | |
key | |||
) |
Retrieve a list of defaults that have values for the given key.
Definition at line 397 of file astconfigparser.py.
References MultiOrderedConfigParser.get_sections().
Referenced by MultiOrderedConfigParser.add_section(), and MultiOrderedConfigParser.default().
def get_sections | ( | self, | |
key, | |||
attr = '_sections' , |
|||
searched = None |
|||
) |
Retrieve a list of sections that have values for the given key. The attr parameter can be used to control what part of the parser to retrieve values from.
Definition at line 375 of file astconfigparser.py.
References MultiOrderedConfigParser._includes, MultiOrderedConfigParser._parent, and MultiOrderedConfigParser.get_sections().
Referenced by MultiOrderedConfigParser.get_defaults(), MultiOrderedConfigParser.get_sections(), and MultiOrderedConfigParser.section().
def includes | ( | self | ) |
Definition at line 419 of file astconfigparser.py.
References MultiOrderedConfigParser._includes.
def multi_get | ( | self, | |
section, | |||
key_list | |||
) |
Retrieves the list of values from a section for a list of keys. This method is intended to be used for equivalent keys. Thus, as soon as any match is found for any key in the key_list, the match is returned. This does not concatenate the lookups of all of the keys together.
Definition at line 449 of file astconfigparser.py.
References Section.get(), MultiOrderedConfigParser.get(), ast_jb_impl.get, and ast_speech_engine.get.
def read | ( | self, | |
filename, | |||
sect = None |
|||
) |
Parse configuration information from a file
Reimplemented in SqlConfigParser.
Definition at line 476 of file astconfigparser.py.
References MultiOrderedConfigParser._read(), MultiOrderedConfigParser.add_default(), MultiOrderedConfigParser.add_include(), MultiOrderedConfigParser.add_section(), astconfigparser.remove_comment(), astconfigparser.try_include(), astconfigparser.try_option(), and astconfigparser.try_section().
def section | ( | self, | |
key | |||
) |
Retrieves a list of dictionaries for a section.
Definition at line 371 of file astconfigparser.py.
References MultiOrderedConfigParser.get_sections().
Referenced by MultiOrderedConfigParser.get(), and MultiOrderedConfigParser.set().
def sections | ( | self | ) |
Definition at line 368 of file astconfigparser.py.
References MultiOrderedConfigParser._sections.
def set | ( | self, | |
section, | |||
key, | |||
val | |||
) |
Sets an option in the given section.
Definition at line 467 of file astconfigparser.py.
References MultiOrderedConfigParser._sections, MultiOrderedConfigParser.defaults(), and MultiOrderedConfigParser.section().
def write | ( | self, | |
config_file | |||
) |
Write configuration information out to a file
Reimplemented in SqlConfigParser.
Definition at line 513 of file astconfigparser.py.
References Section._defaults, MultiOrderedConfigParser._defaults, MultiOrderedConfigParser._includes, MultiOrderedConfigParser._sections, MultiOrderedConfigParser.write(), SqlConfigParser.write(), Registration.write(), ast_bridge_technology.write, ast_channel_tech.write, ast_format_def.write, ast_custom_function.write, aeap_transport_vtable.write, ast_fax_tech.write, ast_rtp_engine.write, ast_speech_engine.write, and astconfigparser.write_dicts().
Referenced by MultiOrderedConfigParser.write().