def __init__(self, name, container_old, container_cur, parent=None, set_sections=unspecified, add_sections=None, set_names=unspecified, add_names=None, set_tags=unspecified, add_tags=None, set_classes=unspecified, add_classes=None, inherit_sections=False): parent = parent or self if inherit_sections and isinstance(parent, TaggedConfigView): add_sections = (parent.get_class_section_list() or []) + (add_sections or []) SimpleConfigView.__init__(self, name, container_old, container_cur, parent, set_sections=set_sections, add_sections=add_sections) self._class_section_list = self._init_variable(parent, '_class_section_list', None, set_classes, add_classes, norm_config_locations, lambda x: x.config_section_list) self._section_name_list = self._init_variable(parent, '_section_name_list', [], set_names, add_names, norm_config_locations) def _get_tag_tuple(tag_obj): try: config_tag_name = tag_obj.config_tag_name.lower() except Exception: raise APIError('Class %r does not define a valid tag name!' % tag_obj.__class__.__name__) return [(config_tag_name, tag_obj.get_object_name().lower())] self._section_tag_list = self._init_variable(parent, '_section_tag_list', [], set_tags, add_tags, identity, _get_tag_tuple) self._section_tag_order = lmap(itemgetter(0), self._section_tag_list)
def __init__(self, name, container_old, container_cur, parent=None, set_sections=unspecified, add_sections=None, set_names=unspecified, add_names=None, set_tags=unspecified, add_tags=None, set_classes=unspecified, add_classes=None, inherit_sections=False): parent = parent or self if inherit_sections and isinstance(parent, TaggedConfigView): add_sections = (parent.get_class_section_list() or []) + (add_sections or []) SimpleConfigView.__init__(self, name, container_old, container_cur, parent, set_sections=set_sections, add_sections=add_sections) self._class_section_list = self._init_variable( parent, '_class_section_list', None, set_classes, add_classes, norm_config_locations, lambda x: x.config_section_list) self._section_name_list = self._init_variable(parent, '_section_name_list', [], set_names, add_names, norm_config_locations) def _get_tag_tuple(tag_obj): try: config_tag_name = tag_obj.config_tag_name.lower() except Exception: raise APIError('Class %r does not define a valid tag name!' % tag_obj.__class__.__name__) return [(config_tag_name, tag_obj.get_object_name().lower())] self._section_tag_list = self._init_variable(parent, '_section_tag_list', [], set_tags, add_tags, identity, _get_tag_tuple) self._section_tag_order = lmap(itemgetter(0), self._section_tag_list)
def __init__(self, name, oldContainer, curContainer, parent=None, setSections=selectorUnchanged, addSections=None, setNames=selectorUnchanged, addNames=None, setTags=selectorUnchanged, addTags=None, setClasses=selectorUnchanged, addClasses=None, inheritSections=False): parent = parent or self if inheritSections and isinstance(parent, TaggedConfigView): addSections = (parent.getClassSections() or []) + (addSections or []) SimpleConfigView.__init__(self, name, oldContainer, curContainer, parent, setSections=setSections, addSections=addSections) self._initVariable(parent, '_cfgClassSections', None, setClasses, addClasses, standardConfigForm, lambda x: x.configSections) self._initVariable(parent, '_cfgNames', [], setNames, addNames, standardConfigForm) def makeTagTuple(t): try: tagName = t.tagName.lower() except Exception: raise APIError('Class %r does not define a valid tag name!' % t.__class__.__name__) return [(tagName, t.getObjectName().lower())] self._initVariable(parent, '_cfgTags', [], setTags, addTags, identity, makeTagTuple) self._cfgTagsOrder = lmap(lambda tagName_tagValue: tagName_tagValue[0], self._cfgTags)
def __init__(self, name, oldContainer, curContainer, parent = None, setSections = selectorUnchanged, addSections = None, setNames = selectorUnchanged, addNames = None, setTags = selectorUnchanged, addTags = None, setClasses = selectorUnchanged, addClasses = None, inheritSections = False): if inheritSections and parent: addSections = parent.getClassSections() + (addSections or []) SimpleConfigView.__init__(self, name, oldContainer, curContainer, parent, setSections = setSections, addSections = addSections) self._initVariable('_cfgClassSections', None, setClasses, addClasses, standardConfigForm, lambda x: x.configSections) self._initVariable('_cfgNames', [], setNames, addNames, standardConfigForm) def makeTagTuple(t): try: tagName = t.tagName.lower() except Exception: raise APIError('Class %r does not define a valid tag name!' % t.__class__.__name__) return [(tagName, t.getObjectName().lower())] self._initVariable('_cfgTags', [], setTags, addTags, identity, makeTagTuple) self._cfgTagsOrder = lmap(lambda tagName_tagValue: tagName_tagValue[0], self._cfgTags)