]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
knotty: use enumerate for task waiting
authorChris Larson <chris_larson@mentor.com>
Tue, 7 Dec 2010 04:58:07 +0000 (21:58 -0700)
committerChris Larson <chris_larson@mentor.com>
Tue, 7 Dec 2010 04:58:32 +0000 (21:58 -0700)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/bb/ui/knotty.py

index b94a3a890de63dac0c6531ebcb19db0235970bad..dea1fd99a7480bd575e60e46c6a000be6d4c7005 100644 (file)
@@ -118,10 +118,8 @@ def init(server, eventHandler):
                 activetasks, failedtasks = helper.getTasks()
                 if activetasks:
                     print("Waiting for %s active tasks to finish:" % len(activetasks))
-                    tasknum = 1
-                    for task in activetasks:
+                    for tasknum, task in enumerate(activetasks):
                         print("%s: %s (pid %s)" % (tasknum, activetasks[task]["title"], task))
-                        tasknum = tasknum + 1
 
             if isinstance(event, logging.LogRecord):
                 logger.handle(event)