From 5139e95a65cf6094711ebf12aca01fb6e9b47c8c Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 27 Feb 2017 16:10:36 -0300 Subject: [style] move path config closer to blobs resource instantiation --- server/src/leap/soledad/server/_blobs.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/leap/soledad/server/_blobs.py b/server/src/leap/soledad/server/_blobs.py index ae09f409..cacabbdf 100644 --- a/server/src/leap/soledad/server/_blobs.py +++ b/server/src/leap/soledad/server/_blobs.py @@ -22,18 +22,14 @@ from twisted.web import resource from ._config import get_config -__all__ = ['blobs_resource'] - - -_config = get_config() -DEFAULT_BLOBS_PATH = _config['blobs_path'] +__all__ = ['BlobsResource', 'blobs_resource'] class BlobsResource(resource.Resource): isLeaf = True - def __init__(self, blobs_path=DEFAULT_BLOBS_PATH): + def __init__(self, blobs_path): resource.Resource.__init__(self) self._blobs_path = blobs_path @@ -41,4 +37,8 @@ class BlobsResource(resource.Resource): return 'blobs is not implemented yet!' -blobs_resource = BlobsResource() +# provide a configured instance of the resource +_config = get_config() +_path = _config['blobs_path'] + +blobs_resource = BlobsResource(_path) -- cgit v1.2.3