コード例 #1
0
    def get_section(self, section_name):
        # check is section with full name is available
        if self._parser.has_section(section_name):
            return PyRevitConfigSectionParser(self._parser, section_name)

        # if not try to match with section_name.subsection
        # if there is a section_name.subsection defined, that should be
        # the sign that the section exists
        # section obj then supports getting all subsections
        for cfg_section_name in self._parser.sections():
            master_section = coreutils.get_canonical_parts(cfg_section_name)[0]
            if section_name == master_section:
                return PyRevitConfigSectionParser(self._parser, master_section)

        # if no match happened then raise exception
        raise AttributeError('Section does not exist in config file.')
コード例 #2
0
 def subheader(self):
     """Section sub-header e.g. Section.SubSection"""
     return coreutils.get_canonical_parts(self.header)[-1]
コード例 #3
0
 def subheader(self):
     return coreutils.get_canonical_parts(self.header)[-1]