Exemple #1
0
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
Exemple #2
0
 def __init__(self):
     self._config = config.load()
     self._root_path = self._config.storage_path
Exemple #3
0
def root():
    cfg = config.load()
    return response('Peer Registry ({0})'.format(cfg.flavor))