Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
    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)
Beispiel #5
0
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
Beispiel #6
0
 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)