[CalendarServer-changes] [11356] CalendarServer/branches/users/glyph/warning-cleanups

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 13 16:21:13 PDT 2013


Revision: 11356
          http://trac.calendarserver.org//changeset/11356
Author:   glyph at apple.com
Date:     2013-06-13 16:21:13 -0700 (Thu, 13 Jun 2013)
Log Message:
-----------
Remove remaining .getchildren() calls.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/warning-cleanups/contrib/performance/loadtest/ical.py
    CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/augment.py
    CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/calendaruserproxyloader.py
    CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/test/test_augment.py
    CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/timezonestdservice.py
    CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/xmlutil.py
    CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/localservers.py
    CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py

Modified: CalendarServer/branches/users/glyph/warning-cleanups/contrib/performance/loadtest/ical.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/contrib/performance/loadtest/ical.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/contrib/performance/loadtest/ical.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -774,13 +774,13 @@
                         self.xmpp[href] = XMPPPush(server, uri, pushkey)
 
             nodes = results[href].getNodeProperties()
-            for nodeType in nodes[davxml.resourcetype].getchildren():
+            for nodeType in nodes[davxml.resourcetype]:
                 if nodeType.tag in self._CALENDAR_TYPES:
                     textProps = results[href].getTextProperties()
                     componentTypes = set()
                     if nodeType.tag == caldavxml.calendar:
                         if caldavxml.supported_calendar_component_set in nodes:
-                            for comp in nodes[caldavxml.supported_calendar_component_set].getchildren():
+                            for comp in nodes[caldavxml.supported_calendar_component_set]:
                                 componentTypes.add(comp.get("name").upper())
 
                     changeTag = davxml.sync_token if self.supportSync else csxml.getctag

Modified: CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/augment.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/augment.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/augment.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -384,7 +384,7 @@
 
         # Make sure UID is present
         changed = False
-        for record_node in augments_node.getchildren():
+        for record_node in augments_node:
             
             if record_node.tag != xmlaugmentsparser.ELEMENT_RECORD:
                 continue
@@ -447,7 +447,7 @@
         self._updateRecordInXMLDB(record, record_node)
 
     def _updateRecordInXMLDB(self, record, recordNode):
-        del recordNode.getchildren()[:]
+        del recordNode[:]
         addSubElement(recordNode, xmlaugmentsparser.ELEMENT_UID, record.uid)
         addSubElement(recordNode, xmlaugmentsparser.ELEMENT_ENABLE, "true" if record.enabled else "false")
         if record.serverID:

Modified: CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/calendaruserproxyloader.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/calendaruserproxyloader.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/calendaruserproxyloader.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -70,7 +70,7 @@
         Parse the XML root node from the augments configuration document.
         @param rootnode: the L{Element} to parse.
         """
-        for child in rootnode.getchildren():
+        for child in rootnode:
             
             if child.tag != ELEMENT_RECORD:
                 raise RuntimeError("Unknown augment type: '%s' in augment file: '%s'" % (child.tag, self.xmlFile,))
@@ -80,7 +80,7 @@
             guid = None
             write_proxies = set()
             read_proxies = set()
-            for node in child.getchildren():
+            for node in child:
                 
                 if node.tag == ELEMENT_GUID:
                     guid = node.text
@@ -104,7 +104,7 @@
                 self._buildRecord(guid, write_proxies, read_proxies)
 
     def _parseMembers(self, node, addto):
-        for child in node.getchildren():
+        for child in node:
             if child.tag == ELEMENT_MEMBER:
                 addto.add(child.text)
     

Modified: CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/test/test_augment.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/test/test_augment.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/directory/test/test_augment.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -310,7 +310,7 @@
         """
 
         _ignore_etree, augments_node = readXML(filename)
-        for record_node in augments_node.getchildren():
+        for record_node in augments_node:
             if record_node.tag != xmlaugmentsparser.ELEMENT_RECORD:
                 continue
             uid = record_node.find(xmlaugmentsparser.ELEMENT_UID).text

Modified: CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/timezonestdservice.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/timezonestdservice.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/timezonestdservice.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -527,7 +527,7 @@
         """
         _ignore, root = xmlutil.readXML(self.xmlfile, "timezones")
         self.dtstamp = root.findtext("dtstamp")
-        for child in root.getchildren():
+        for child in root:
             if child.tag == "timezone":
                 tz = TimezoneInfo.readXML(child)
                 if tz:

Modified: CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/xmlutil.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/xmlutil.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/twistedcaldav/xmlutil.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -72,14 +72,14 @@
         
         if node.text is not None and node.text.strip():
             return
-        elif len(node.getchildren()):
+        elif len(node):
             indent = "\n" + " " * (level + 1) * INDENT
             node.text = indent
-            for child in node.getchildren():
+            for child in node:
                 child.tail = indent
                 _indentNode(child, level + 1)
-            if len(node.getchildren()):
-                node.getchildren()[-1].tail = "\n" + " " * level * INDENT
+            if len(node):
+                node[-1].tail = "\n" + " " * level * INDENT
 
     _indentNode(root, 0)
     data += XML.tostring(root) + "\n"

Modified: CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/localservers.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/localservers.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/localservers.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -269,7 +269,7 @@
         except ValueError, e:
             raise RuntimeError("XML parse error for '%s' because: %s" % (xmlFile, e,))
 
-        for child in servers_node.getchildren():
+        for child in servers_node:
 
             if child.tag != ELEMENT_SERVER:
                 raise RuntimeError("Unknown server type: '%s' in servers file: '%s'" % (child.tag, xmlFile,))
@@ -277,7 +277,7 @@
             server = Server()
             server.isImplicit = child.get(ATTR_IMPLICIT, ATTR_VALUE_YES) == ATTR_VALUE_YES
 
-            for node in child.getchildren():
+            for node in child:
                 if node.tag == ELEMENT_ID:
                     server.id = node.text
                 elif node.tag == ELEMENT_URI:
@@ -303,14 +303,14 @@
     @staticmethod
     def _parsePartition(xmlFile, partitions, server):
 
-        for child in partitions.getchildren():
+        for child in partitions:
 
             if child.tag != ELEMENT_PARTITION:
                 raise RuntimeError("Unknown partition type: '%s' in servers file: '%s'" % (child.tag, xmlFile,))
 
             id = None
             uri = None
-            for node in child.getchildren():
+            for node in child:
                 if node.tag == ELEMENT_ID:
                     id = node.text
                 elif node.tag == ELEMENT_URI:

Modified: CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py
===================================================================
--- CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py	2013-06-13 23:21:11 UTC (rev 11355)
+++ CalendarServer/branches/users/glyph/warning-cleanups/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py	2013-06-13 23:21:13 UTC (rev 11356)
@@ -127,7 +127,7 @@
         @param node: the L{Node} to parse.
         """
 
-        for child in node.getchildren():
+        for child in node:
             if child.tag == ELEMENT_SERVER:
                 self.servers.append(IScheduleServerRecord())
                 self.servers[-1].parseXML(child)
@@ -169,7 +169,7 @@
 
 
     def parseXML(self, node):
-        for child in node.getchildren():
+        for child in node:
             if child.tag == ELEMENT_URI:
                 self.uri = child.text
             elif child.tag == ELEMENT_AUTHENTICATION:
@@ -189,7 +189,7 @@
 
 
     def _parseList(self, node, element_name, appendto):
-        for child in node.getchildren():
+        for child in node:
             if child.tag == element_name:
                 appendto.append(child.text)
 
@@ -198,7 +198,7 @@
         if node.get(ATTRIBUTE_TYPE) != ATTRIBUTE_BASICAUTH:
             return
 
-        for child in node.getchildren():
+        for child in node:
             if child.tag == ELEMENT_USER:
                 user = child.text
             elif child.tag == ELEMENT_PASSWORD:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130613/1ca49d65/attachment-0001.html>


More information about the calendarserver-changes mailing list