[CalendarServer-changes] [4987] CalendarServer/branches/users/cdaboo/deployment-partition-4722/ calendarserver/tools/manageaugments.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 29 12:28:16 PST 2010


Revision: 4987
          http://trac.macosforge.org/projects/calendarserver/changeset/4987
Author:   cdaboo at apple.com
Date:     2010-01-29 12:28:14 -0800 (Fri, 29 Jan 2010)
Log Message:
-----------
Handle an empty file.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/manageaugments.py

Modified: CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/manageaugments.py
===================================================================
--- CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/manageaugments.py	2010-01-29 20:19:41 UTC (rev 4986)
+++ CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/manageaugments.py	2010-01-29 20:28:14 UTC (rev 4987)
@@ -79,7 +79,8 @@
                 error("Cannot add guid '%s' because it already exists in augment file: '%s'" % (guid, xmlfile,))
     
     # Create new record
-    augments_node.getchildren()[-1].tail = "\n  "
+    if len(augments_node.getchildren()):
+        augments_node.getchildren()[-1].tail = "\n  "
     record = addSubElement(augments_node, xmlaugmentsparser.ELEMENT_RECORD, "\n    ")
     addSubElement(record, xmlaugmentsparser.ELEMENT_GUID, guid, 4)
     addSubElement(record, xmlaugmentsparser.ELEMENT_ENABLE, "true", 4)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100129/51a2e60b/attachment.html>


More information about the calendarserver-changes mailing list