def _get(self, section, option): """Like .get, but returns the real section name and the value.""" name, data = self._get_section(section) if data is None: raise configparser.NoSectionError(section) try: return name, data[option] except KeyError: raise configparser.NoOptionError(option, name)
def options(self, section): for section_prefix in self.section_prefixes: real_section = section_prefix + section if configparser.RawConfigParser.has_section(self, real_section): return configparser.RawConfigParser.options(self, real_section) raise configparser.NoSectionError(section)
def options(self, section): _, data = self._get_section(section) if data is None: raise configparser.NoSectionError(section) return list(data.keys())