[CalendarServer-changes] [5093] CalendarServer/branches/users/sagen/resources-2/calendarserver/tools

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 11 19:08:03 PST 2010


Revision: 5093
          http://trac.macosforge.org/projects/calendarserver/changeset/5093
Author:   sagen at apple.com
Date:     2010-02-11 19:08:03 -0800 (Thu, 11 Feb 2010)
Log Message:
-----------
Setting autoschedule not hooked up yet

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/gateway.py
    CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/test/test_gateway.py

Modified: CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/gateway.py
===================================================================
--- CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/gateway.py	2010-02-12 02:48:01 UTC (rev 5092)
+++ CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/gateway.py	2010-02-12 03:08:03 UTC (rev 5093)
@@ -192,6 +192,8 @@
         guid = command['GeneratedUID']
         record = self.dir.recordWithGUID(guid)
         recordDict = recordToDict(record)
+        # principal = principalForPrincipalID(guid, directory=self.dir)
+        # recordDict['AutoSchedule'] = principal.getAutoSchedule()
         respond(command, recordDict)
 
     def command_setLocationAttributes(self, command):
@@ -204,6 +206,11 @@
             self.dir.updateRecord("locations", **kwargs)
         except DirectoryError, e:
             abort(str(e))
+
+        # principal = principalForPrincipalID(command['GeneratedUID'],
+        #     directory=self.dir)
+        # principal.setAutoSchedule(command.get('AutoSchedule', False))
+
         respondWithRecordsOfType(self.dir, command, "locations")
 
     def command_deleteLocation(self, command):
@@ -237,6 +244,8 @@
         guid = command['GeneratedUID']
         record = self.dir.recordWithGUID(guid)
         recordDict = recordToDict(record)
+        # principal = principalForPrincipalID(guid, directory=self.dir)
+        # recordDict['AutoSchedule'] = principal.getAutoSchedule()
         respond(command, recordDict)
 
     def command_setResourceAttributes(self, command):
@@ -249,6 +258,11 @@
             self.dir.updateRecord("resources", **kwargs)
         except DirectoryError, e:
             abort(str(e))
+
+        # principal = principalForPrincipalID(command['GeneratedUID'],
+        #     directory=self.dir)
+        # principal.setAutoSchedule(command.get('AutoSchedule', False))
+
         respondWithRecordsOfType(self.dir, command, "resources")
 
     def command_deleteResource(self, command):

Modified: CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/test/test_gateway.py
===================================================================
--- CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/test/test_gateway.py	2010-02-12 02:48:01 UTC (rev 5092)
+++ CalendarServer/branches/users/sagen/resources-2/calendarserver/tools/test/test_gateway.py	2010-02-12 03:08:03 UTC (rev 5093)
@@ -215,13 +215,13 @@
     def test_createLocation(self):
         directory = getDirectory()
 
-        record = directory.recordWithUID("createdlocation01")
+        record = directory.recordWithUID("836B1B66-2E9A-4F46-8B1C-3DD6772C20B2")
         self.assertEquals(record, None)
 
         yield self.runCommand(command_createLocation)
 
         directory.flushCaches()
-        record = directory.recordWithUID("createdlocation01")
+        record = directory.recordWithUID("836B1B66-2E9A-4F46-8B1C-3DD6772C20B2")
         self.assertNotEquals(record, None)
 
         self.assertEquals(record.extras['comment'], "Test Comment")
@@ -240,10 +240,10 @@
         directory = getDirectory()
 
         yield self.runCommand(command_createLocation)
-        record = directory.recordWithUID("createdlocation01")
+        record = directory.recordWithUID("836B1B66-2E9A-4F46-8B1C-3DD6772C20B2")
         yield self.runCommand(command_setLocationAttributes)
         directory.flushCaches()
-        record = directory.recordWithUID("createdlocation01")
+        record = directory.recordWithUID("836B1B66-2E9A-4F46-8B1C-3DD6772C20B2")
 
         self.assertEquals(record.extras['comment'], "Updated Test Comment")
         self.assertEquals(record.extras['building'], "Updated Test Building")
@@ -273,13 +273,13 @@
     def test_createResource(self):
         directory = getDirectory()
 
-        record = directory.recordWithUID("guidlaptop1")
+        record = directory.recordWithUID("AF575A61-CFA6-49E1-A0F6-B5662C9D9801")
         self.assertEquals(record, None)
 
         yield self.runCommand(command_createResource)
 
         directory.flushCaches()
-        record = directory.recordWithUID("guidlaptop1")
+        record = directory.recordWithUID("AF575A61-CFA6-49E1-A0F6-B5662C9D9801")
         self.assertNotEquals(record, None)
 
     @inlineCallbacks
@@ -287,13 +287,13 @@
         directory = getDirectory()
 
         yield self.runCommand(command_createResource)
-        record = directory.recordWithUID("guidlaptop1")
+        record = directory.recordWithUID("AF575A61-CFA6-49E1-A0F6-B5662C9D9801")
         self.assertEquals(record.fullName, "Laptop 1")
 
         yield self.runCommand(command_setResourceAttributes)
 
         directory.flushCaches()
-        record = directory.recordWithUID("guidlaptop1")
+        record = directory.recordWithUID("AF575A61-CFA6-49E1-A0F6-B5662C9D9801")
         self.assertEquals(record.fullName, "Updated Laptop 1")
 
     @inlineCallbacks
@@ -359,7 +359,7 @@
         <key>AutoSchedule</key>
         <true/>
         <key>GeneratedUID</key>
-        <string>createdlocation01</string>
+        <string>836B1B66-2E9A-4F46-8B1C-3DD6772C20B2</string>
         <key>RealName</key>
         <string>Created Location 01</string>
         <key>RecordName</key>
@@ -402,7 +402,7 @@
         <key>AutoSchedule</key>
         <true/>
         <key>GeneratedUID</key>
-        <string>guidlaptop1</string>
+        <string>AF575A61-CFA6-49E1-A0F6-B5662C9D9801</string>
         <key>RealName</key>
         <string>Laptop 1</string>
         <key>RecordName</key>
@@ -520,7 +520,7 @@
         <key>AutoSchedule</key>
         <false/>
         <key>GeneratedUID</key>
-        <string>createdlocation01</string>
+        <string>836B1B66-2E9A-4F46-8B1C-3DD6772C20B2</string>
         <key>RealName</key>
         <string>Updated Location 01</string>
         <key>RecordName</key>
@@ -560,7 +560,7 @@
         <key>command</key>
         <string>getLocationAttributes</string>
         <key>GeneratedUID</key>
-        <string>createdlocation01</string>
+        <string>836B1B66-2E9A-4F46-8B1C-3DD6772C20B2</string>
 </dict>
 </plist>
 """
@@ -574,7 +574,7 @@
         <key>AutoSchedule</key>
         <false/>
         <key>GeneratedUID</key>
-        <string>guidlaptop1</string>
+        <string>AF575A61-CFA6-49E1-A0F6-B5662C9D9801</string>
         <key>RealName</key>
         <string>Updated Laptop 1</string>
         <key>RecordName</key>
@@ -592,7 +592,7 @@
         <key>command</key>
         <string>getResourceAttributes</string>
         <key>GeneratedUID</key>
-        <string>guidlaptop1</string>
+        <string>AF575A61-CFA6-49E1-A0F6-B5662C9D9801</string>
 </dict>
 </plist>
 """
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100211/a911bc6c/attachment-0001.html>


More information about the calendarserver-changes mailing list