[CalendarServer-changes] [4997] CalDAVTester/trunk/src/serverinfo.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 1 13:13:25 PST 2010


Revision: 4997
          http://trac.macosforge.org/projects/calendarserver/changeset/4997
Author:   cdaboo at apple.com
Date:     2010-02-01 13:13:24 -0800 (Mon, 01 Feb 2010)
Log Message:
-----------
Handle empty or non-repeating substitutions.

Modified Paths:
--------------
    CalDAVTester/trunk/src/serverinfo.py

Modified: CalDAVTester/trunk/src/serverinfo.py
===================================================================
--- CalDAVTester/trunk/src/serverinfo.py	2010-02-01 19:32:46 UTC (rev 4996)
+++ CalDAVTester/trunk/src/serverinfo.py	2010-02-01 21:13:24 UTC (rev 4997)
@@ -127,11 +127,11 @@
                 if schild._get_localName() == src.xmlDefs.ELEMENT_KEY:
                     key = schild.firstChild.data.encode("utf-8")
                 elif schild._get_localName() == src.xmlDefs.ELEMENT_VALUE:
-                    value = schild.firstChild.data.encode("utf-8")
+                    value = schild.firstChild.data.encode("utf-8") if schild.firstChild else ""
 
             if key and value:
                 if repeat:
                     for count in range(1, int(repeat) + 1):
-                        self.subsdict[key % (count,)] = value % (count,)
+                        self.subsdict[key % (count,)] = (value % (count,)) if "%" in value else value
                 else:
                     self.subsdict[key] = value
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100201/99b48378/attachment.html>


More information about the calendarserver-changes mailing list