def __init__(self, parent=None): super().__init__(parent) self._initialized = False self._configdir = None self._fname = None self.sections = configdata.data() self._interpolation = configparser.ExtendedInterpolation() self._proxies = {} for sectname in self.sections: self._proxies[sectname] = SectionProxy(self, sectname)
def __init__(self, configdir, fname, relaxed=False, parent=None): super().__init__(parent) self._initialized = False self.sections = configdata.data() self._interpolation = configparser.ExtendedInterpolation() self._proxies = {} for sectname in self.sections: self._proxies[sectname] = SectionProxy(self, sectname) self._fname = fname if configdir is None: self._configdir = None self._initialized = True else: self._configdir = configdir parser = ini.ReadConfigParser(configdir, fname) self._from_cp(parser, relaxed) self._initialized = True self._validate_all()
def __init__(self, configdir, fname, relaxed=False, parent=None): super().__init__(parent) self._initialized = False self.sections = configdata.data() self._interpolation = configparser.ExtendedInterpolation() self._proxies = {} for sectname in self.sections.keys(): self._proxies[sectname] = SectionProxy(self, sectname) self._fname = fname if configdir is None: self._configdir = None self._initialized = True else: self._configdir = configdir parser = ini.ReadConfigParser(configdir, fname) self._from_cp(parser, relaxed) self._initialized = True self._validate_all()
def test_data(): """Some simple sanity tests on data().""" data = configdata.data() assert 'general' in data assert 'ignore-case' in data['general']