buildman: Show the number of builds remaining
authorSimon Glass <sjg@chromium.org>
Thu, 9 Apr 2020 21:08:45 +0000 (15:08 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 21 Apr 2020 12:33:47 +0000 (06:33 -0600)
It is nice to see the actual number of builds remaining to complete. Add
this in the progress message, using a different colour.

Drop the unnecessary 'name' variable while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/builder.py

index ae8eee16e35475af2afd96bcf9f827766d62426a..b9caf6cf9c164ba3da1b288364be9d4bda74dca8 100644 (file)
@@ -444,16 +444,21 @@ class Builder:
         line += self.col.Color(self.col.YELLOW, '%5d' % self.warned)
         line += self.col.Color(self.col.RED, '%5d' % self.fail)
 
-        name = ' /%-5d  ' % self.count
+        line += ' /%-5d  ' % self.count
+        remaining = self.count - self.upto
+        if remaining:
+            line += self.col.Color(self.col.MAGENTA, ' -%-5d  ' % remaining)
+        else:
+            line += ' ' * 8
 
         # Add our current completion time estimate
         self._AddTimestamp()
         if self._complete_delay:
-            name += '%s  : ' % self._complete_delay
+            line += '%s  : ' % self._complete_delay
 
-        name += target
+        line += target
         terminal.PrintClear()
-        Print(line + name, newline=False)
+        Print(line, newline=False)
 
     def _GetOutputDir(self, commit_upto):
         """Get the name of the output directory for a commit number