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."""
|
||||
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):
|
||||
"""Update an item.
|
||||
|
||||
@ -596,6 +583,19 @@ class Collection(BaseCollection):
|
||||
|
||||
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
|
||||
def move(cls, item, to_collection, to_href):
|
||||
os.replace(
|
||||
|
Loading…
Reference in New Issue
Block a user