[CalendarServer-changes] [422] CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/ repository.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Nov 9 19:57:49 PST 2006


Revision: 422
          http://trac.macosforge.org/projects/calendarserver/changeset/422
Author:   wsanchez at apple.com
Date:     2006-11-09 19:57:48 -0800 (Thu, 09 Nov 2006)

Log Message:
-----------
No hack is really worth doing unless it's *totally* obscenely
hackalicious.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/repository.py

Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/repository.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/repository.py	2006-11-10 02:24:36 UTC (rev 421)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/repository.py	2006-11-10 03:57:48 UTC (rev 422)
@@ -178,8 +178,26 @@
         # FIXME: This is a hack to make this config work for now
         implements(IDirectoryService)
 
-        service = None
+        _service = None
+        _attrs = {}
 
+        def getService(self):
+            return self._service
+        def setService(self, service):
+            if self._service is not None:
+                raise AssertionError("bleargh")
+            for attr, value in self._attrs.items():
+                setattr(service, attr, value)
+            def set(name, value):
+                object.__setattr__(service, name, value)
+            def get(name):
+                object.__getattr__(service, name)
+            object.__setattr__(self, "_service", service)
+            object.__setattr__(self, "__setattr__", set)
+            object.__setattr__(self, "__getattr__", get)
+
+        service = property(getService, setService)
+
         def __getattr__(self, name):
             attr = getattr(self.service, name)
 
@@ -194,7 +212,7 @@
             if name == "service":
                 object.__setattr__(self, name, value)
             else:
-                raise AttributeError("Attributes are read-only")
+                self._attrs[name] = value
 
     directory = DirectoryServiceProxy()
 

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


More information about the calendarserver-changes mailing list