Rename collections to vobject_items
Like the parameter name of upload_all
This commit is contained in:
parent
6045ad97fe
commit
c57307c585
@ -552,7 +552,7 @@ class Collection(BaseCollection):
|
|||||||
items.extend(
|
items.extend(
|
||||||
getattr(collection, "%s_list" % content, []))
|
getattr(collection, "%s_list" % content, []))
|
||||||
items_by_uid = groupby(sorted(items, key=get_uid), get_uid)
|
items_by_uid = groupby(sorted(items, key=get_uid), get_uid)
|
||||||
collections = {}
|
vobject_items = {}
|
||||||
for uid, items in items_by_uid:
|
for uid, items in items_by_uid:
|
||||||
new_collection = vobject.iCalendar()
|
new_collection = vobject.iCalendar()
|
||||||
for item in items:
|
for item in items:
|
||||||
@ -561,14 +561,14 @@ class Collection(BaseCollection):
|
|||||||
# Prevent infinite loop
|
# Prevent infinite loop
|
||||||
for _ in range(10000):
|
for _ in range(10000):
|
||||||
href = self._find_available_file_name()
|
href = self._find_available_file_name()
|
||||||
if href not in collections:
|
if href not in vobject_items:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise FileExistsError(
|
raise FileExistsError(
|
||||||
errno.EEXIST, "No usable file name found")
|
errno.EEXIST, "No usable file name found")
|
||||||
collections[href] = new_collection
|
vobject_items[href] = new_collection
|
||||||
|
|
||||||
self.upload_all(collections)
|
self.upload_all(vobject_items)
|
||||||
elif props.get("tag") == "VCARD":
|
elif props.get("tag") == "VCARD":
|
||||||
for card in collection:
|
for card in collection:
|
||||||
self.upload(self._find_available_file_name(), card)
|
self.upload(self._find_available_file_name(), card)
|
||||||
|
Loading…
Reference in New Issue
Block a user