mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Finish HttpStorage
This commit is contained in:
parent
6143726d0b
commit
5e2c66ece1
1 changed files with 4 additions and 12 deletions
|
|
@ -57,20 +57,12 @@ class HttpStorage(Storage):
|
||||||
for item in split_collection(r.text):
|
for item in split_collection(r.text):
|
||||||
self._items[item.uid] = item
|
self._items[item.uid] = item
|
||||||
|
|
||||||
for uid in self._items.keys():
|
for uid, item in self._items.items():
|
||||||
yield uid, hashlib.sha256(item.raw)
|
yield uid, hashlib.sha256(item.raw)
|
||||||
|
|
||||||
def get(self, href):
|
def get(self, href):
|
||||||
((actual_href, obj, etag),) = self.get_multi([href])
|
x = self._items[href]
|
||||||
assert href == actual_href
|
return x, hashlib.sha256(x.raw)
|
||||||
return obj, etag
|
|
||||||
|
|
||||||
def get_multi(self, hrefs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def has(self, href):
|
def has(self, href):
|
||||||
'''
|
return href in self._items
|
||||||
check if item exists by href
|
|
||||||
:returns: True or False
|
|
||||||
'''
|
|
||||||
raise NotImplementedError()
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue