[CalendarServer-changes] [480] CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/ directory

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 15 17:52:07 PST 2006


Revision: 480
          http://trac.macosforge.org/projects/calendarserver/changeset/480
Author:   wsanchez at apple.com
Date:     2006-11-15 17:52:07 -0800 (Wed, 15 Nov 2006)

Log Message:
-----------
Implement listRecords() for groups.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/apache.py
    CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/test/test_apache.py

Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/apache.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/apache.py	2006-11-16 01:49:57 UTC (rev 479)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/apache.py	2006-11-16 01:52:07 UTC (rev 480)
@@ -54,15 +54,17 @@
 
     def listRecords(self, recordType):
         if recordType == "user":
-            for entry in self.userFile.open():
-                if entry and entry[0] != "#":
-                    user, password = entry.split(":")
-                    yield user
+            recordFile = self.userFile
         elif recordType == "group":
-            raise NotImplementedError()
+            recordFile = self.groupFile
         else:
             raise UnknownRecordTypeError("Unknown record type: %s" % (recordType,))
 
+        for entry in recordFile.open():
+            if entry and entry[0] != "#":
+                shortName, rest = entry.split(":")
+                yield shortName
+
     def recordWithShortName(self, recordType, shortName):
         raise NotImplementedError()
 

Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/test/test_apache.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/test/test_apache.py	2006-11-16 01:49:57 UTC (rev 479)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/test/test_apache.py	2006-11-16 01:52:07 UTC (rev 480)
@@ -77,8 +77,6 @@
         service = FileDirectoryService(basicUserFile, groupFile)
         self.assertEquals(set(service.listRecords("group")), set(groups.keys()))
 
-    test_listRecords_group.todo = "unimplemented"
-
     def test_recordWithShortName_user(self):
         """
         FileDirectoryService.recordWithShortName("user")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061115/b83892f0/attachment.html


More information about the calendarserver-changes mailing list