changeset 432:acf97c1a06e0 treepkg-status

fix handling of showing only successfull builds together with num packages
author Bjoern Ricks <bricks@intevation.de>
date Thu, 29 Jul 2010 14:50:53 +0000
parents 0953704dc49e
children 9926ced5d477
files treepkg/info/status.py
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/info/status.py	Thu Jul 29 13:43:39 2010 +0000
+++ b/treepkg/info/status.py	Thu Jul 29 14:50:53 2010 +0000
@@ -91,16 +91,18 @@
         revisions = track.get_revisions()
         revisions = sorted(revisions, key=lambda r: r.status.start,
                            reverse=True)
+        canidates = revsisions
+        if self.success: # skip not successful builds
+            candidates = [rev for rev in revisions
+                          if rev.status.status.finished 
+                            and not rev.status.status.error]
+
         if self.numnewestrev > 0:
-            revisions = revisions[:self.numnewestrev]
+            canditates = candidates[:self.numnewestrev]
 
         arch = None
 
-        for rev in revisions:
-            if self.success: # skip not successful builds
-                if not rev.status.status.finished \
-                    or rev.status.status.error:
-                    continue
+        for rev in candidates:
             revision = rev.revision
             rules_revision = rev.rules_revision
             status  = rev.status.status.description  # extend status
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)