[Checkins] SVN: zc.monitor/branches/benji-add-sticky-commands/src/zc/monitor/__init__.py works; no tests

Benji York benji at zope.com
Tue Oct 27 14:29:59 EDT 2009


Log message for revision 105307:
  works; no tests
  

Changed:
  U   zc.monitor/branches/benji-add-sticky-commands/src/zc/monitor/__init__.py

-=-
Modified: zc.monitor/branches/benji-add-sticky-commands/src/zc/monitor/__init__.py
===================================================================
--- zc.monitor/branches/benji-add-sticky-commands/src/zc/monitor/__init__.py	2009-10-27 18:29:29 UTC (rev 105306)
+++ zc.monitor/branches/benji-add-sticky-commands/src/zc/monitor/__init__.py	2009-10-27 18:29:59 UTC (rev 105307)
@@ -23,6 +23,7 @@
 
 INTERACTIVE_MARKER = object()
 QUIT_MARKER = object()
+MORE_MARKER = object()
 
 class Server:
 
@@ -36,7 +37,9 @@
 
     def handle_input(self, connection, data):
         args = data.strip().split()
-        if not args:
+        if self.mode is MORE_MARKER:
+            command_name = self.last_command[0]
+        elif not args:
             if self.last_command is not None:
                 command_name, args = self.last_command
             else:
@@ -57,10 +60,8 @@
                 traceback.print_exc(100, connection)
                 print >> connection, "%s: %s\n" % (v.__class__.__name__, v)
             else:
-                if res is INTERACTIVE_MARKER:
+                if res in (INTERACTIVE_MARKER, QUIT_MARKER, MORE_MARKER):
                     self.mode = res
-                elif res is QUIT_MARKER:
-                    self.mode = res
 
         if self.mode is QUIT_MARKER:
             connection.write(zc.ngi.END_OF_DATA)
@@ -83,7 +84,7 @@
             # Don't kill the process just because somebody else has our port.
             # This might be a zopectl debug or some other innocuous problem.
             logging.warning(
-                'unable to start z3monitor server because port %d is in use.',
+                'unable to start zc.monitor server because port %d is in use.',
                 port)
             return False
         else:



More information about the checkins mailing list