[CalendarServer-changes] [786] CalendarServer/trunk/twistedcaldav/config.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Dec 8 23:00:51 PST 2006


Revision: 786
          http://trac.macosforge.org/projects/calendarserver/changeset/786
Author:   wsanchez at apple.com
Date:     2006-12-08 23:00:50 -0800 (Fri, 08 Dec 2006)

Log Message:
-----------
Make config an object, so we can use '.' syntax

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/config.py

Modified: CalendarServer/trunk/twistedcaldav/config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/config.py	2006-12-09 06:52:06 UTC (rev 785)
+++ CalendarServer/trunk/twistedcaldav/config.py	2006-12-09 07:00:50 UTC (rev 786)
@@ -57,8 +57,18 @@
     'AdminPrincipals': ['/principal/users/admin']
 }
 
-config = dict(defaults)
+class Config (object):
+    def __init__(self, defaults):
+        self.update(defaults)
 
+    def update(self, items):
+        if type(items) is dict:
+            items = items.iteritems()
+        for key, value in items:
+            setattr(self, key, value)
+
+config = Config(defaults)
+
 def parseConfig(configFile):
     if os.path.exists(configFile):
         plist = readPlist(configFile)

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


More information about the calendarserver-changes mailing list