Skip to content

Commit

Permalink
metasync
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Sep 3, 2015
1 parent 89bcf34 commit ef7fa16
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vdirsyncer/storage/remotestorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,17 @@ def delete(self, href, etag):
def get(self, href):
response = self.session.request('GET', href)
return Item(response.text), response.headers['etag']

def get_meta(self, key):
try:
return self.session.request('GET', key).text or None
except exceptions.NotFoundError:
pass

def set_meta(self, key, value):
self.session.request(
'PUT',
key,
data=value.encode('utf-8'),
headers={'Content-Type': 'text/plain'}
)

0 comments on commit ef7fa16

Please sign in to comment.