def load(kind=None): """ Returns the right storage class according to the configuration """ global _storage if not kind: kind = config.load().storage.lower() if kind in _storage: return _storage[kind] if kind == 'local': store = LocalStorage() else: raise ValueError('Not supported storage \'{0}\''.format(kind)) _storage[kind] = store return store
def __init__(self): self._config = config.load() self._root_path = self._config.storage_path
def root(): cfg = config.load() return response('Peer Registry ({0})'.format(cfg.flavor))