diff options
author | drebs <drebs@leap.se> | 2017-12-06 18:09:40 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-12-13 13:43:47 -0200 |
commit | 6f29df7d0a8c68fb5aaf4de38d68b8c3de1a4aaa (patch) | |
tree | e27ccf85a1c5722571ca012b348ed4e49e60017e /src/leap/soledad | |
parent | 87413812397c24db807643c99ce0c42803cc7e43 (diff) |
[refactor] make blobs backend count() agnostic of twisted.web requests
Diffstat (limited to 'src/leap/soledad')
-rw-r--r-- | src/leap/soledad/server/_blobs.py | 4 | ||||
-rw-r--r-- | src/leap/soledad/server/interfaces.py | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py index 8393d5bf..8e9d9524 100644 --- a/src/leap/soledad/server/_blobs.py +++ b/src/leap/soledad/server/_blobs.py @@ -152,7 +152,7 @@ class FilesystemBlobsBackend(object): blob_path = self._get_path(user, blob_id, namespace) return os.stat(blob_path).st_size - def count(self, user, request, namespace=''): + def count(self, user, namespace=''): base_path = self._get_path(user, namespace=namespace) count = 0 for _, _, filenames in os.walk(base_path): @@ -277,7 +277,7 @@ class BlobsResource(resource.Resource): logger.info("http get: %s" % request.path) user, blob_id, namespace = self._validate(request) if not blob_id and request.args.get('only_count', [False])[0]: - return self._handler.count(user, request, namespace) + return self._handler.count(user, namespace) elif not blob_id: order = request.args.get('order_by', [None])[0] filter_flag = request.args.get('filter_flag', [False])[0] diff --git a/src/leap/soledad/server/interfaces.py b/src/leap/soledad/server/interfaces.py index 15603047..d19a0adc 100644 --- a/src/leap/soledad/server/interfaces.py +++ b/src/leap/soledad/server/interfaces.py @@ -98,15 +98,12 @@ class IBlobsBackend(Interface): :rtype: int """ - def count(user, request, namespace=''): + def count(user, namespace=''): """ Count the total number of blobs. :param user: The id of the user who owns the blob. :type user: str - :param request: A representation of all of the information about the - request that is being made. - :type request: twisted.web.server.Request :param namespace: Restrict the count to a certain namespace. :type namespace: str |