diff options
| author | Joshua Lock <josh@linux.intel.com> | 2010-11-25 15:54:19 +0000 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-12-07 12:51:16 +0000 |
| commit | 84384aa8a9b052a4740fd266694ecb4990b6edf5 (patch) | |
| tree | e73407b13378bf5a389b28a9af9fcff18b2a529c /bitbake | |
| parent | 1307d64286802dbaa1d58260cc50200d5f49f92c (diff) | |
| download | poky-84384aa8a9b052a4740fd266694ecb4990b6edf5.tar.gz | |
bitbake/crumbs: add optional pbar parameter to RunningBuild.handle_event()
Defaults to None, but if set will pass the ParseProgress sofar and total to
pbar's update() method.
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | 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 d4ba4b7476..9730bfd472 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): | |||
| 48 | gobject.GObject.__init__ (self) | 48 | gobject.GObject.__init__ (self) |
| 49 | self.model = RunningBuildModel() | 49 | self.model = RunningBuildModel() |
| 50 | 50 | ||
| 51 | def handle_event (self, event): | 51 | def handle_event (self, event, pbar=None): |
| 52 | # Handle an event from the event queue, this may result in updating | 52 | # Handle an event from the event queue, this may result in updating |
| 53 | # the model and thus the UI. Or it may be to tell us that the build | 53 | # the model and thus the UI. Or it may be to tell us that the build |
| 54 | # has finished successfully (or not, as the case may be.) | 54 | # has finished successfully (or not, as the case may be.) |
| @@ -162,6 +162,14 @@ class RunningBuild (gobject.GObject): | |||
| 162 | else: | 162 | else: |
| 163 | self.emit ("build-succeeded") | 163 | self.emit ("build-succeeded") |
| 164 | 164 | ||
| 165 | elif isinstance(event, bb.event.ParseProgress) and pbar: | ||
| 166 | x = event.sofar | ||
| 167 | y = event.total | ||
| 168 | if x == y: | ||
| 169 | pbar.hide() | ||
| 170 | return | ||
| 171 | pbar.update(x, y) | ||
| 172 | |||
| 165 | class RunningBuildTreeView (gtk.TreeView): | 173 | class RunningBuildTreeView (gtk.TreeView): |
| 166 | def __init__ (self): | 174 | def __init__ (self): |
| 167 | gtk.TreeView.__init__ (self) | 175 | gtk.TreeView.__init__ (self) |
