Esempio n. 1
0
    def configure(self, configuration):
        for param in configuration['arguments']:
            if param.find('=') != -1:
                key, value = param[:param.find('=')], param[param.find('=') +
                                                            1:]
            else:
                key, value = param, ''

            if key == 'database': self.database = value
            elif key == 'directory': self.directory = value
            elif key == 'prefix': self.prefix = value
            else:
                raise RuntimeError('Unsupported configuration option: ' +
                                   param)

        self.impl = PyStorage_replicator(self.ctxt)
        self.storage = self.ctxt.resolve(str(TransactionalStorage))