Asterisk - The Open Source Telephony Project
18.5.0
|
Public Member Functions | |
def | __cmp__ (self, other) |
def | __eq__ (self, other) |
def | __ge__ (self, other) |
def | __getitem__ (self, key) |
def | __gt__ (self, other) |
def | __init__ (self, defaults=None, templates=None) |
def | __le__ (self, other) |
def | __lt__ (self, other) |
def | add_defaults (self, defaults) |
def | add_templates (self, templates) |
def | get (self, key, from_self=True, from_templates=True, from_defaults=True) |
def | get_merged (self, key) |
def | keys (self, self_only=False) |
Public Member Functions inherited from MultiOrderedDict | |
def | __init__ (self, args, kwds) |
def | __setitem__ (self, key, val, i=None) |
def | copy (self) |
def | insert (self, i, key, val) |
Public Member Functions inherited from OrderedDict | |
def | __delitem__ (self, key, dict_delitem=dict.__delitem__) |
def | __eq__ (self, other) |
def | __init__ (self, args, kwds) |
def | __iter__ (self) |
def | __ne__ (self, other) |
def | __reduce__ (self) |
def | __repr__ (self, _repr_running={}) |
def | __reversed__ (self) |
def | __setitem__ (self, key, value, dict_setitem=dict.__setitem__) |
def | clear (self) |
def | copy (self) |
def | fromkeys (cls, iterable, value=None) |
def | items (self) |
def | iteritems (self) |
def | iterkeys (self) |
def | itervalues (self) |
def | keys (self) |
def | pop (self, key, default=__marker) |
def | popitem (self, last=True) |
def | setdefault (self, key, default=None) |
def | update (args, kwds) |
def | values (self) |
def | viewitems (self) |
def | viewkeys (self) |
def | viewvalues (self) |
Data Fields | |
id | |
Static Public Attributes | |
int | count = 0 |
A Section is a MultiOrderedDict itself that maintains a list of key/value options. However, in the case of an Asterisk config file a section may have other defaults sections that is can pull data from (i.e. templates). So when an option is looked up by key it first checks the base section and if not found looks in the added default sections. If not found at that point then a 'KeyError' exception is raised.
Definition at line 29 of file astconfigparser.py.
def __init__ | ( | self, | |
defaults = None , |
|||
templates = None |
|||
) |
Definition at line 41 of file astconfigparser.py.
def __cmp__ | ( | self, | |
other | |||
) |
Use self.id as means of determining equality
Definition at line 49 of file astconfigparser.py.
References Section.id, audiosocket_instance.id, native_rtp_framehook_data.id, adsi_event.id, adapter_pvt.id, mbl_pvt.id, adsi_soft_key.id, adsi_subscript.id, adsi_state.id, adsi_flag.id, adsi_display.id, mgcp_subchannel.id, unistim_device.id, cfsip_methods.id, conf_menu_action.id, adsi_key_cmd.id, sip_mailbox.id, id, cfsip_options.id, and local_optimization.id.
def __eq__ | ( | self, | |
other | |||
) |
Use self.id as means of determining equality
Definition at line 55 of file astconfigparser.py.
References Section.id, audiosocket_instance.id, native_rtp_framehook_data.id, adsi_event.id, adapter_pvt.id, mbl_pvt.id, adsi_soft_key.id, adsi_subscript.id, adsi_state.id, adsi_flag.id, adsi_display.id, mgcp_subchannel.id, unistim_device.id, cfsip_methods.id, conf_menu_action.id, adsi_key_cmd.id, sip_mailbox.id, id, cfsip_options.id, and local_optimization.id.
def __ge__ | ( | self, | |
other | |||
) |
Use self.id as means of determining equality
Definition at line 79 of file astconfigparser.py.
References Section.get(), Section.id, audiosocket_instance.id, native_rtp_framehook_data.id, adsi_event.id, adapter_pvt.id, mbl_pvt.id, adsi_soft_key.id, adsi_subscript.id, adsi_state.id, adsi_flag.id, adsi_display.id, mgcp_subchannel.id, unistim_device.id, cfsip_methods.id, conf_menu_action.id, adsi_key_cmd.id, sip_mailbox.id, id, cfsip_options.id, and local_optimization.id.
def __getitem__ | ( | self, | |
key | |||
) |
Get the value for the given key. If it is not found in the 'self' then check inside templates and defaults before declaring raising a KeyError exception.
Definition at line 121 of file astconfigparser.py.
References Section.get(), ast_speech_engine.get, and ast_jb_impl.get.
def __gt__ | ( | self, | |
other | |||
) |
Use self.id as means of determining equality
Definition at line 67 of file astconfigparser.py.
References Section.id, audiosocket_instance.id, native_rtp_framehook_data.id, adsi_event.id, adapter_pvt.id, mbl_pvt.id, adsi_soft_key.id, adsi_subscript.id, adsi_state.id, adsi_flag.id, adsi_display.id, mgcp_subchannel.id, unistim_device.id, cfsip_methods.id, conf_menu_action.id, adsi_key_cmd.id, sip_mailbox.id, id, cfsip_options.id, and local_optimization.id.
def __le__ | ( | self, | |
other | |||
) |
Use self.id as means of determining equality
Definition at line 73 of file astconfigparser.py.
References Section.id, audiosocket_instance.id, native_rtp_framehook_data.id, adsi_event.id, adapter_pvt.id, mbl_pvt.id, adsi_soft_key.id, adsi_subscript.id, adsi_state.id, adsi_flag.id, adsi_display.id, mgcp_subchannel.id, unistim_device.id, cfsip_methods.id, conf_menu_action.id, adsi_key_cmd.id, sip_mailbox.id, id, cfsip_options.id, and local_optimization.id.
def __lt__ | ( | self, | |
other | |||
) |
Use self.id as means of determining equality
Definition at line 61 of file astconfigparser.py.
References Section.id, audiosocket_instance.id, native_rtp_framehook_data.id, adsi_event.id, adapter_pvt.id, mbl_pvt.id, adsi_soft_key.id, adsi_subscript.id, adsi_state.id, adsi_flag.id, adsi_display.id, mgcp_subchannel.id, unistim_device.id, cfsip_methods.id, conf_menu_action.id, adsi_key_cmd.id, sip_mailbox.id, id, cfsip_options.id, and local_optimization.id.
def add_defaults | ( | self, | |
defaults | |||
) |
Add a list of defaults to the section. Defaults are sections such as 'general'
Definition at line 150 of file astconfigparser.py.
References Section._defaults, and MultiOrderedDict.insert().
def add_templates | ( | self, | |
templates | |||
) |
Add a list of templates to the section.
Definition at line 159 of file astconfigparser.py.
References Section._templates, and MultiOrderedDict.insert().
def get | ( | self, | |
key, | |||
from_self = True , |
|||
from_templates = True , |
|||
from_defaults = True |
|||
) |
Get the values corresponding to a given key. The parameters to this function form a hierarchy that determines priority of the search. from_self takes priority over from_templates, and from_templates takes priority over from_defaults. Parameters: from_self - If True, search within the given section. from_templates - If True, search in this section's templates. from_defaults - If True, search within this section's defaults.
Definition at line 86 of file astconfigparser.py.
References Section._defaults, and Section._templates.
Referenced by Section.__ge__(), Section.__getitem__(), and MultiOrderedConfigParser.multi_get().
def get_merged | ( | self, | |
key | |||
) |
Return a list of values for a given key merged from default(s)
Definition at line 167 of file astconfigparser.py.
References Section._defaults, Section._templates, and astconfigparser.merge_values().
def keys | ( | self, | |
self_only = False |
|||
) |
Get the keys from this section. If self_only is True, then keys from this section's defaults and templates are not included in the returned value
Definition at line 129 of file astconfigparser.py.
References Section._defaults, and Section._templates.
|
static |
Definition at line 39 of file astconfigparser.py.
id |
Definition at line 45 of file astconfigparser.py.
Referenced by Section.__cmp__(), Section.__eq__(), Section.__ge__(), Section.__gt__(), Section.__le__(), Section.__lt__(), and Model.load().