def config(pluginclass): config = confit.Configuration('test_scantailor') tmpl = pluginclass.configuration_template() for key, option in tmpl.items(): if option.selectable: config['scantailor'][key] = option.value[0] else: config['scantailor'][key] = option.value return config
def config(tmpdir): config = confit.Configuration('test_chdkcamera') tmpl = chdkcamera.CHDKCameraDevice.configuration_template() for key, option in tmpl.items(): if option.selectable: config[key] = option.value[0] else: config[key] = option.value return config
def config(): config = confit.Configuration('test_chdkcamera') tmpl = chdkcamera.CHDKCameraDevice.configuration_template() for key, option in tmpl.items(): if option.selectable: config[key] = option.value[0] else: config[key] = option.value config['chdkptp_path'] = u'/tmp/chdkptp' return config
def __init__(self, appname='spreads'): """ Create new instance and load default and current configuration. :param appname: Application name, configuration will be loaded from this name's default configuration directory """ self._config = confit.Configuration(appname, __name__) self._config.read() if 'plugins' not in self._config.keys(): self['plugins'] = [] self.load_templates() self.load_defaults(overwrite=False)
def config(tmpdir): config = confit.Configuration('test_chdkcamera') tmpl = chdkcamera.CHDKCameraDevice.configuration_template() for key, option in tmpl.items(): if option.selectable: config[key] = option.value[0] else: config[key] = option.value chdkptp_path = tmpdir.join('chdkptp') chdkptp_path.mkdir() with chdkptp_path.join('chdkptp').open('w') as fp: fp.write('foo') config['chdkptp_path'] = unicode(chdkptp_path) return config
def __init__(self, appname='spreads'): self._config = confit.Configuration(appname, __name__) self._config.read() if 'plugins' not in self._config.keys(): self['plugins'] = [] self.load_defaults(overwrite=False)