diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/progress.py')
| -rw-r--r-- | bitbake/lib/bb/ui/crumbs/progress.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/progress.py b/bitbake/lib/bb/ui/crumbs/progress.py new file mode 100644 index 0000000000..8bd87108e6 --- /dev/null +++ b/bitbake/lib/bb/ui/crumbs/progress.py | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | import gtk | ||
| 2 | |||
| 3 | class ProgressBar(gtk.Dialog): | ||
| 4 | def __init__(self, parent): | ||
| 5 | |||
| 6 | gtk.Dialog.__init__(self) | ||
| 7 | self.set_title("Parsing metadata, please wait...") | ||
| 8 | self.set_default_size(500, 0) | ||
| 9 | self.set_transient_for(parent) | ||
| 10 | self.set_destroy_with_parent(True) | ||
| 11 | self.progress = gtk.ProgressBar() | ||
| 12 | self.vbox.pack_start(self.progress) | ||
| 13 | self.show_all() | ||
| 14 | |||
| 15 | def update(self, x, y): | ||
| 16 | self.progress.set_fraction(float(x)/float(y)) | ||
| 17 | self.progress.set_text("%d/%d (%2d %%)" % (x, y, x*100/y)) | ||
