[svn] commit: r2968 - in /branches/trac292: ./ src/lib/python/isc/config/ccsession.py

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 17 10:22:05 UTC 2010


Author: fujiwara
Date: Fri Sep 17 10:22:05 2010
New Revision: 2968

Log:
copyed from experiments/fujiwara-stats/src/lib/python/isc/config/ccsession.py
and added comments from jelte's comment.

Added:
    branches/trac292/
      - copied from r2930, trunk/
Modified:
    branches/trac292/src/lib/python/isc/config/ccsession.py

Modified: branches/trac292/src/lib/python/isc/config/ccsession.py
==============================================================================
--- branches/trac292/src/lib/python/isc/config/ccsession.py (original)
+++ branches/trac292/src/lib/python/isc/config/ccsession.py Fri Sep 17 10:22:05 2010
@@ -174,11 +174,18 @@
         """Close the session to the command channel"""
         self._session.close()
 
-    def check_command(self):
-        """Check whether there is a command or configuration update
-           on the channel. Call the corresponding callback function if
-           there is."""
-        msg, env = self._session.group_recvmsg(False)
+    def check_command(self, nonblock = False):
+        """Check whether there is a command or configuration update on
+           the channel. Calls check_command_without_recvmsg() to parse
+           the received message."""
+        msg, env = self._session.group_recvmsg(nonblock)
+        self.check_command_without_recvmsg(msg, env)
+
+    def check_command_without_recvmsg(self, msg, env):
+        """Parse the given message to see if there is a command or a
+           configuration update. Calls the corresponding handler
+           functions if present. Responds on the channel if the
+           handler returns a message.""" 
         # should we default to an answer? success-by-default? unhandled error?
         if msg and not 'result' in msg:
             answer = None




More information about the bind10-changes mailing list