poky/bitbake/lib/bb/ui/crumbs/progress.py
Jason Wessel eab93b0d62 bitbake: progress.py: Fix traceback when running goggle ui
The following traceback appears when running the following command after the
devshell is exited.

bitbake -u goggle -c devshell busybox

-- traceback --
Traceback (most recent call last):
  File "/work/bitbake/lib/bb/ui/goggle.py", line 35, in event_handle_idle_func
    build.handle_event (event, pbar)
  File "/work/bitbake/lib/bb/ui/crumbs/runningbuild.py", line 299, in handle_event
    pbar.set_text(event.msg)
AttributeError: 'ProgressBar' object has no attribute 'set_text'

(Bitbake rev: a6cc53cdb3c34fc8fd01bbc5ce0008429dc6785c)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-24 15:35:31 +01:00

24 lines
714 B
Python

import gtk
class ProgressBar(gtk.Dialog):
def __init__(self, parent):
gtk.Dialog.__init__(self, flags=(gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT))
self.set_title("Parsing metadata, please wait...")
self.set_default_size(500, 0)
self.set_transient_for(parent)
self.progress = gtk.ProgressBar()
self.vbox.pack_start(self.progress)
self.show_all()
def set_text(self, msg):
self.progress.set_text(msg)
def update(self, x, y):
self.progress.set_fraction(float(x)/float(y))
self.progress.set_text("%2d %%" % (x*100/y))
def pulse(self):
self.progress.set_text("Loading...")
self.progress.pulse()