Move upload_all from BaseCollection to Collection
This is not used anywhere outside of Collection and probably never will be as WebDAV doesn't support bulk uploads.
This commit is contained in:
parent
79bfa9c1d3
commit
6045ad97fe
@ -321,19 +321,6 @@ class BaseCollection:
|
|||||||
"""Upload a new item."""
|
"""Upload a new item."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def upload_all(self, vobject_items):
|
|
||||||
"""Upload a new set of items.
|
|
||||||
|
|
||||||
This takes a mapping of href and vobject items and
|
|
||||||
returns a list of uploaded items.
|
|
||||||
Might bring optimizations on some storages.
|
|
||||||
|
|
||||||
"""
|
|
||||||
return [
|
|
||||||
self.upload(href, vobject_item)
|
|
||||||
for href, vobject_item in vobject_items.items()
|
|
||||||
]
|
|
||||||
|
|
||||||
def update(self, href, vobject_item):
|
def update(self, href, vobject_item):
|
||||||
"""Update an item.
|
"""Update an item.
|
||||||
|
|
||||||
@ -596,6 +583,19 @@ class Collection(BaseCollection):
|
|||||||
|
|
||||||
return cls(sane_path, principal=principal)
|
return cls(sane_path, principal=principal)
|
||||||
|
|
||||||
|
def upload_all(self, vobject_items):
|
||||||
|
"""Upload a new set of items.
|
||||||
|
|
||||||
|
This takes a mapping of href and vobject items and
|
||||||
|
returns a list of uploaded items.
|
||||||
|
Might bring optimizations on some storages.
|
||||||
|
|
||||||
|
"""
|
||||||
|
return [
|
||||||
|
self.upload(href, vobject_item)
|
||||||
|
for href, vobject_item in vobject_items.items()
|
||||||
|
]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def move(cls, item, to_collection, to_href):
|
def move(cls, item, to_collection, to_href):
|
||||||
os.replace(
|
os.replace(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user