1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 17:39:31 +00:00
Files
poky/bitbake/lib/bb/ui/crumbs/progress.py
T
Joshua Lock fb62c54e13 bitbake/progress: add method to pulse the progress bar
When we're running a long operation with indeterminate duration it's useful
to use the gtk.ProgressBar's pulse method to show that something is happening
but we don't know how long it will take.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:53 +00:00

22 lines
632 B
Python

import gtk
class ProgressBar(gtk.Dialog):
def __init__(self, parent):
gtk.Dialog.__init__(self)
self.set_title("Parsing metadata, please wait...")
self.set_default_size(500, 0)
self.set_transient_for(parent)
self.set_destroy_with_parent(True)
self.progress = gtk.ProgressBar()
self.vbox.pack_start(self.progress)
self.show_all()
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()