Hello! We are running our annual fundraising. Please consider making a donation if you value this freely available service or want to support people around the world working towards liberatory social change. https://riseup.net/donate.

Commit 5139e95a authored by drebs's avatar drebs
Browse files

[style] move path config closer to blobs resource instantiation

parent 7eb1ffa1
Pipeline #2114 passed with stages
in 8 minutes and 20 seconds
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment