Clarify docs

This commit is contained in:
Markus Unterwaditzer 2017-01-17 11:44:59 +01:00
parent b8ad1def85
commit 3cdd1f6644

View file

@ -166,9 +166,10 @@ class Storage(metaclass=StorageMeta):
def upload(self, item): def upload(self, item):
'''Upload a new item. '''Upload a new item.
In cases where the new etag is not known, this method may return `None` In cases where the new etag cannot be atomically determined (i.e. in
as etag. This special case only exists because of DAV. Avoid this the same "transaction" as the upload itself), this method may return
situation whenever possible. `None` as etag. This special case only exists because of DAV. Avoid
this situation whenever possible.
:raises: :exc:`vdirsyncer.exceptions.PreconditionFailed` if there is :raises: :exc:`vdirsyncer.exceptions.PreconditionFailed` if there is
already an item with that href. already an item with that href.
@ -180,9 +181,7 @@ class Storage(metaclass=StorageMeta):
def update(self, href, item, etag): def update(self, href, item, etag):
'''Update an item. '''Update an item.
In cases where the new etag is not known, this method may return `None` The etag may be none in some cases, see `upload`.
as etag. This special case only exists because of DAV. Avoid this
situation whenever possible.
:raises: :exc:`vdirsyncer.exceptions.PreconditionFailed` if the etag on :raises: :exc:`vdirsyncer.exceptions.PreconditionFailed` if the etag on
the server doesn't match the given etag or if the item doesn't the server doesn't match the given etag or if the item doesn't