[poky] [PATCH 06/10] bitbake/crumbs: add optional pbar parameter to RunningBuild.handle_event()

Joshua Lock josh at linux.intel.com
Thu Nov 25 07:54:19 PST 2010


Defaults to None, but if set will pass the ParseProgress sofar and total to
pbar's update() method.

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 bitbake/lib/bb/ui/crumbs/runningbuild.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
index d4ba4b7..9730bfd 100644
--- a/bitbake/lib/bb/ui/crumbs/runningbuild.py
+++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -48,7 +48,7 @@ class RunningBuild (gobject.GObject):
         gobject.GObject.__init__ (self)
         self.model = RunningBuildModel()
 
-    def handle_event (self, event):
+    def handle_event (self, event, pbar=None):
         # Handle an event from the event queue, this may result in updating
         # the model and thus the UI. Or it may be to tell us that the build
         # has finished successfully (or not, as the case may be.)
@@ -162,6 +162,14 @@ class RunningBuild (gobject.GObject):
             else:
                 self.emit ("build-succeeded")
 
+        elif isinstance(event, bb.event.ParseProgress) and pbar:
+            x = event.sofar
+            y = event.total
+            if x == y:
+                pbar.hide()
+                return
+            pbar.update(x, y)
+
 class RunningBuildTreeView (gtk.TreeView):
     def __init__ (self):
         gtk.TreeView.__init__ (self)
-- 
1.7.3.2




More information about the poky mailing list