[CalendarServer-changes] [12975] CalendarServer/branches/users/sagen/move2who-4

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 19 17:08:06 PDT 2014


Revision: 12975
          http://trac.calendarserver.org//changeset/12975
Author:   wsanchez at apple.com
Date:     2014-03-19 17:08:06 -0700 (Wed, 19 Mar 2014)
Log Message:
-----------
Get rid of listRecords(); we have recordsWithRecordType().

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/gateway.py
    CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/vfs.py
    CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/addressbook.py
    CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/principal.py
    CalendarServer/branches/users/sagen/move2who-4/txdav/dps/client.py
    CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py

Modified: CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/gateway.py
===================================================================
--- CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/gateway.py	2014-03-20 00:06:42 UTC (rev 12974)
+++ CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/gateway.py	2014-03-20 00:08:06 UTC (rev 12975)
@@ -607,7 +607,7 @@
     def respondWithRecordsOfTypes(self, directory, command, recordTypes):
         result = []
         for recordType in recordTypes:
-            for record in directory.listRecords(recordType):
+            for record in directory.recordsWithRecordType(recordType):
                 recordDict = recordToDict(record)
                 result.append(recordDict)
         self.respond(command, result)

Modified: CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/vfs.py
===================================================================
--- CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/vfs.py	2014-03-20 00:06:42 UTC (rev 12974)
+++ CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/vfs.py	2014-03-20 00:08:06 UTC (rev 12975)
@@ -334,7 +334,9 @@
     def list(self):
         names = set()
 
-        for record in self.service.directory.listRecords(self.recordType):
+        for record in self.service.directory.recordsWithRecordType(
+            self.recordType
+        ):
             for shortName in record.shortNames:
                 if shortName in names:
                     continue

Modified: CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/addressbook.py
===================================================================
--- CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/addressbook.py	2014-03-20 00:06:42 UTC (rev 12974)
+++ CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/addressbook.py	2014-03-20 00:08:06 UTC (rev 12975)
@@ -188,7 +188,9 @@
     def listChildren(self):
         if config.EnablePrincipalListings:
             children = []
-            for record in (yield self.directory.listRecords(self.recordType)):
+            for record in (
+                yield self.directory.recordsWithRecordType(self.recordType)
+            ):
                 if record.enabledForAddressBooks:
                     for shortName in record.shortNames:
                         children.append(shortName)

Modified: CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/principal.py
===================================================================
--- CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/principal.py	2014-03-20 00:06:42 UTC (rev 12974)
+++ CalendarServer/branches/users/sagen/move2who-4/twistedcaldav/directory/principal.py	2014-03-20 00:08:06 UTC (rev 12975)
@@ -493,7 +493,9 @@
         children = []
         if config.EnablePrincipalListings:
             try:
-                for record in (yield self.directory.listRecords(self.recordType)):
+                for record in (
+                    yield self.directory.recordsWithRecordType(self.recordType)
+                ):
                     for shortName in record.shortNames:
                         children.append(shortName)
             except AttributeError:

Modified: CalendarServer/branches/users/sagen/move2who-4/txdav/dps/client.py
===================================================================
--- CalendarServer/branches/users/sagen/move2who-4/txdav/dps/client.py	2014-03-20 00:06:42 UTC (rev 12974)
+++ CalendarServer/branches/users/sagen/move2who-4/txdav/dps/client.py	2014-03-20 00:08:06 UTC (rev 12975)
@@ -231,9 +231,7 @@
             recordType=recordType.name.encode("utf-8")
         )
 
-    listRecords = recordsWithRecordType
 
-
     def recordsWithEmailAddress(self, emailAddress):
         return self._call(
             RecordsWithEmailAddressCommand,

Modified: CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py
===================================================================
--- CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py	2014-03-20 00:06:42 UTC (rev 12974)
+++ CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py	2014-03-20 00:08:06 UTC (rev 12975)
@@ -170,18 +170,7 @@
         returnValue(augmented)
 
 
-    # FIXME: This shouldn't be here; we have recordsWithRecordType() above
     @inlineCallbacks
-    def listRecords(self, recordType):
-        records = yield self._directory.listRecords(recordType)
-        augmented = []
-        for record in records:
-            record = yield self._augment(record)
-            augmented.append(record)
-        returnValue(augmented)
-
-
-    @inlineCallbacks
     def updateRecords(self, records, create=False):
         return self._directory.updateRecords(records, create=create)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140319/adaddd25/attachment.html>


More information about the calendarserver-changes mailing list