[Calypso-commits] [calypso] 01/01: Use item when possible, rather than collection.
Jelmer Vernooij
jelmer at moszumanska.debian.org
Mon May 9 20:08:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
jelmer pushed a commit to branch master
in repository calypso.
commit b76c5670f0c3a7b564b703f5fa09946b80f68fbe
Author: Jelmer Vernooij <jelmer at jelmer.uk>
Date: Thu Apr 14 01:02:18 2016 +0000
Use item when possible, rather than collection.
This matters, as item can represent a subcollection.
---
calypso/xmlutils.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/calypso/xmlutils.py b/calypso/xmlutils.py
index 09971e3..e01fcb0 100644
--- a/calypso/xmlutils.py
+++ b/calypso/xmlutils.py
@@ -158,10 +158,10 @@ def propfind(path, xml_request, collection, depth, context):
for tag in props:
element = ET.Element(tag)
if tag == _tag("D", "resourcetype") and is_collection:
- if collection.is_calendar:
+ if item.is_calendar:
tag = ET.Element(_tag("C", "calendar"))
element.append(tag)
- if collection.is_addressbook:
+ if item.is_addressbook:
tag = ET.Element(_tag("A", "addressbook"))
element.append(tag)
tag = ET.Element(_tag("D", "collection"))
@@ -178,9 +178,9 @@ def propfind(path, xml_request, collection, depth, context):
elif tag == _tag("D", "getetag"):
element.text = item.etag
elif tag == _tag("D", "displayname") and is_collection:
- element.text = collection.name
+ element.text = item.name
elif tag == _tag("E", "calendar-color") and is_collection:
- element.text = collection.color
+ element.text = item.color
elif tag == _tag("D", "principal-URL"):
# TODO: use a real principal URL, read rfc3744-4.2 for info
tag = ET.Element(_tag("D", "href"))
@@ -222,7 +222,7 @@ def propfind(path, xml_request, collection, depth, context):
element.append(tag)
elif tag in (_tag("A", "addressbook-description"),
_tag("C", "calendar-description")) and is_collection:
- element.text = collection.get_description()
+ element.text = item.get_description()
prop.append(element)
status = ET.Element(_tag("D", "status"))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/calypso/calypso.git
More information about the Calypso-commits
mailing list