[CalendarServer-changes] [2561] CalendarServer/trunk/twistedcaldav/util.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jun 16 14:40:58 PDT 2008


Revision: 2561
          http://trac.macosforge.org/projects/calendarserver/changeset/2561
Author:   wsanchez at apple.com
Date:     2008-06-16 14:40:57 -0700 (Mon, 16 Jun 2008)

Log Message:
-----------
Add Alternator

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

Modified: CalendarServer/trunk/twistedcaldav/util.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/util.py	2008-06-16 21:25:09 UTC (rev 2560)
+++ CalendarServer/trunk/twistedcaldav/util.py	2008-06-16 21:40:57 UTC (rev 2561)
@@ -74,3 +74,19 @@
         submodule = getattr(submodule, m)
 
     return submodule
+
+class Alternator (object):
+    """
+    Object that alternates between True and False states.
+    """
+    def __init__(self, state=False):
+        self._state = bool(state)
+
+    def state(self):
+        """
+        @return: the current state
+        """
+        state = self._state
+        self._state = not state
+        return state
+

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080616/c4ec4f22/attachment.htm 


More information about the calendarserver-changes mailing list