[CalendarServer-changes] [8525] CalendarServer/branches/users/glyph/skip-lonely-vtimezones

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 13 14:02:54 PST 2012


Revision: 8525
          http://trac.macosforge.org/projects/calendarserver/changeset/8525
Author:   glyph at apple.com
Date:     2012-01-13 14:02:54 -0800 (Fri, 13 Jan 2012)
Log Message:
-----------
allow class properties to be recalculated

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext/python/clsprop.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/skip-lonely-vtimezones/

Modified: CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext/python/clsprop.py
===================================================================
--- CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext/python/clsprop.py	2012-01-13 22:01:31 UTC (rev 8524)
+++ CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext/python/clsprop.py	2012-01-13 22:02:54 UTC (rev 8525)
@@ -25,12 +25,19 @@
     will be returned for that class.
     """
 
-    def __init__(self, thunk):
+    def __init__(self, thunk=None, cache=True):
+        self.cache = cache
         self.thunk = thunk
         self._classcache = {}
 
 
+    def __call__(self, thunk):
+        return self.__class__(thunk, self.cache)
+
+
     def __get__(self, instance, owner):
+        if not self.cache:
+            return self.thunk(owner)
         cc = self._classcache
         if owner in cc:
             cached = cc[owner]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120113/bcce7944/attachment.html>


More information about the calendarserver-changes mailing list