]> git.itanic.dy.fi Git - emerge-timer/commitdiff
Move the current emerge check
authorEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 13 Aug 2011 16:07:47 +0000 (19:07 +0300)
committerEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 13 Aug 2011 16:07:47 +0000 (19:07 +0300)
Check if there are current emerges going on
earlier in the code and exit the function then.

emerge-timer.py

index c81304be4b910cadfba4bc24a3ba73afad8a1935..3179ed5590716afc22ac44f00c486e955eb493e6 100755 (executable)
@@ -200,6 +200,10 @@ def list_emerge_processes(f):
                     if time > p[1]:
                         p[1] = time
 
+    if len(packages) == 0:
+        print "No current emerge process found."
+        return
+
     a = 1
     for p in packages:
         now = datetime.datetime.today()
@@ -219,9 +223,6 @@ def list_emerge_processes(f):
                     p[0].partition('-')[2].partition('-')[0])
             main_loop(f, name, True)
 
-    if len(packages) == 0:
-        print "No current emerge process found."
-
 
 
 def main_loop(f, package, silent):