[Zodb-checkins] SVN: zdaemon/trunk/src/zdaemon/zdctl.py Bug fixed: wrong version committed in 82079

Florent Xicluna laxyf at yahoo.fr
Sun Dec 2 12:14:21 EST 2007


Log message for revision 82080:
  Bug fixed: wrong version committed in 82079
  

Changed:
  U   zdaemon/trunk/src/zdaemon/zdctl.py

-=-
Modified: zdaemon/trunk/src/zdaemon/zdctl.py
===================================================================
--- zdaemon/trunk/src/zdaemon/zdctl.py	2007-12-02 17:08:48 UTC (rev 82079)
+++ zdaemon/trunk/src/zdaemon/zdctl.py	2007-12-02 17:14:20 UTC (rev 82080)
@@ -194,26 +194,28 @@
         return resp
 
     def awhile(self, cond, msg):
+        n = 0
         was_running = False
         try:
-            for n in range(10):
-                if self.get_status(): # running?
-                    was_running = True
-                elif was_running: # no longer running?
-                    break
-                if cond(): # condition fulfilled?
-                    break
+            if self.get_status():
+                was_running = True
+
+            while not cond():
                 sys.stdout.write(". ")
                 sys.stdout.flush()
                 time.sleep(1)
+                n += 1
+                if self.get_status():
+                    was_running = True
+                elif (was_running or n > 10) and not cond():
+                    print "\ndaemon manager not running"
+                    return
 
         except KeyboardInterrupt:
             print "^C"
-
-        if not cond():
-            msg = "daemon manager not running"
         print "\n" + msg % self.__dict__
 
+
     def help_help(self):
         print "help          -- Print a list of available actions."
         print "help <action> -- Print help for <action>."



More information about the Zodb-checkins mailing list