[Neo-report] r2259 vincent - /trunk/neo/connection.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Aug 28 10:31:00 CEST 2010


Author: vincent
Date: Sat Aug 28 10:31:00 2010
New Revision: 2259

Log:
Add BaseConnection.isPending() .

Also, make HandlerSwitcher.isPending() return a boolean, to avoid leaking
instance content to foreign code.

Modified:
    trunk/neo/connection.py

Modified: trunk/neo/connection.py
==============================================================================
--- trunk/neo/connection.py [iso-8859-1] (original)
+++ trunk/neo/connection.py [iso-8859-1] Sat Aug 28 10:31:00 2010
@@ -94,7 +94,7 @@ class HandlerSwitcher(object):
         self._pending = [[{}, handler]]
 
     def isPending(self):
-        return self._pending[0][0]
+        return bool(self._pending[0][0])
 
     def getHandler(self):
         return self._pending[0][1]
@@ -268,6 +268,9 @@ class BaseConnection(object):
         self._timeout = Timeout()
         event_manager.register(self)
 
+    def isPending(self):
+        return self._handlers.isPending()
+
     def checkTimeout(self, t):
         handlers = self._handlers
         if handlers.isPending():





More information about the Neo-report mailing list