SVN: zdaemon/trunk/src/zdaemon/zdctl.py Bug fixed: wrong version committed in 82079

Florent Xicluna <[email protected]>
Newsgroups gmane.comp.web.zope.zope3.cvs
Message-ID <[email protected]>
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>."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.