From 5e2c66ece1d09a39a1b0ae1c290a59bc04629589 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 9 Mar 2014 01:11:35 +0100 Subject: [PATCH] Finish HttpStorage --- vdirsyncer/storage/http.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/vdirsyncer/storage/http.py b/vdirsyncer/storage/http.py index d4e9c4a..1d7105c 100644 --- a/vdirsyncer/storage/http.py +++ b/vdirsyncer/storage/http.py @@ -57,20 +57,12 @@ class HttpStorage(Storage): for item in split_collection(r.text): self._items[item.uid] = item - for uid in self._items.keys(): + for uid, item in self._items.items(): yield uid, hashlib.sha256(item.raw) def get(self, href): - ((actual_href, obj, etag),) = self.get_multi([href]) - assert href == actual_href - return obj, etag - - def get_multi(self, hrefs): - pass + x = self._items[href] + return x, hashlib.sha256(x.raw) def has(self, href): - ''' - check if item exists by href - :returns: True or False - ''' - raise NotImplementedError() + return href in self._items