BitBake UI changes for OE-Core pkgdata improvements
cover BitBake UI changes for OE-Core pkgdata improvements
These changes correspond with the ones sent for OE-Core that change how PKGSIZE and FILES_INFO are written in pkgdata (affecting the Hob and Toaster UIs) as well as a minor related code cleanup.
The following changes since commit 78ad15b669b9c7cde41f7bd1ab884c1d2e0db91b:
hob: fix rotating progress icon animation (2013-12-02 17:51:27 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/pkgdata-bb
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/pkgdata-bb
Paul Eggleton (3):
lib/bb/ui: handle PKGSIZE change to bytes
hob: name package files list variables appropriately
hob: fix package property dialog for changes to FILES_INFO
lib/bb/ui/buildinfohelper.py | 2 +- lib/bb/ui/crumbs/hig/propertydialog.py | 64 +++++++++++++--------------------- lib/bb/ui/crumbs/hoblistmodel.py | 7 ++-- 3 files changed, 29 insertions(+), 44 deletions(-)
Signature · 1 line
1.8.1.2
PATCH 1/3 lib/bb/ui: handle PKGSIZE change to bytes
PKGSIZE is now in bytes in pkgdata, so we need to treat it as such in the UI code for Hob / Toaster.
--- lib/bb/ui/buildinfohelper.py | 2 +- lib/bb/ui/crumbs/hoblistmodel.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-)
lib/bb/ui/buildinfohelper.py +1 -1
@@ -188,7 +188,7 @@ class ORMWrapper(object): revision = package_info['PKGR'], summary = package_info['SUMMARY'], description = package_info['DESCRIPTION'], - size = int(package_info['PKGSIZE']) * 1024, + size = int(package_info['PKGSIZE']), section = package_info['SECTION'], license = package_info['LICENSE'], )
lib/bb/ui/crumbs/hoblistmodel.py +3 -4
@@ -251,7 +251,7 @@ class PackageListModel(gtk.ListStore): pkgv = getpkgvalue(pkginfo, 'PKGV', pkg) pkgr = getpkgvalue(pkginfo, 'PKGR', pkg) # PKGSIZE is artificial, will always be overridden with the package name if present - pkgsize = pkginfo.get('PKGSIZE_%s' % pkg, "0") + pkgsize = int(pkginfo.get('PKGSIZE_%s' % pkg, "0")) # PKG_%s is the renamed version pkg_rename = pkginfo.get('PKG_%s' % pkg, "") # The rest may be overridden or not
@@ -268,11 +268,10 @@ class PackageListModel(gtk.ListStore): allow_empty = getpkgvalue(pkginfo, 'ALLOW_EMPTY', pkg, "") - if pkgsize == "0" and not allow_empty: + if pkgsize == 0 and not allow_empty: continue - # pkgsize is in KB - size = HobPage._size_to_string(HobPage._string_to_size(pkgsize + ' KB')) + size = HobPage._size_to_string(pkgsize) self.set(self.append(), self.COL_NAME, pkg, self.COL_VER, pkgv, self.COL_REV, pkgr, self.COL_RNM, pkg_rename, self.COL_SEC, section, self.COL_SUM, summary,
Signature · 1 line
1.8.1.2
PATCH 2/3 hob: name package files list variables appropriately
In reply to Paul EggletonThis treeview code was obviously copy-pasted from one of the config dialogs and the variables were never renamed. Rename them now to improve readability.
--- lib/bb/ui/crumbs/hig/propertydialog.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
lib/bb/ui/crumbs/hig/propertydialog.py +11 -11
@@ -187,17 +187,17 @@ class PropertyDialog(CrumbsDialog): self.textWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.textWindow.set_size_request(100, 170) - sstatemirrors_store = gtk.ListStore(str) + packagefiles_store = gtk.ListStore(str) - self.sstatemirrors_tv = gtk.TreeView() - self.sstatemirrors_tv.set_rules_hint(True) - self.sstatemirrors_tv.set_headers_visible(True) - self.textWindow.add(self.sstatemirrors_tv) + self.packagefiles_tv = gtk.TreeView() + self.packagefiles_tv.set_rules_hint(True) + self.packagefiles_tv.set_headers_visible(True) + self.textWindow.add(self.packagefiles_tv) self.cell1 = gtk.CellRendererText() col1 = gtk.TreeViewColumn('Package files', self.cell1) col1.set_cell_data_func(self.cell1, self.regex_field) - self.sstatemirrors_tv.append_column(col1) + self.packagefiles_tv.append_column(col1) for items in file_list.split(']'): if len(items) > 1:
@@ -223,15 +223,15 @@ class PropertyDialog(CrumbsDialog): items = items[:len(items)/2] + "..." + items[len(items)/2+3:] self.tooltip_items[items] = temp - sstatemirrors_store.append([str(items)]) + packagefiles_store.append([str(items)]) - self.sstatemirrors_tv.set_model(sstatemirrors_store) + self.packagefiles_tv.set_model(packagefiles_store) tips = gtk.Tooltips() - tips.set_tip(self.sstatemirrors_tv, "") - self.sstatemirrors_tv.connect("motion-notify-event", self.treeViewTooltip, tips, 0) - self.sstatemirrors_tv.set_events(gtk.gdk.POINTER_MOTION_MASK) + tips.set_tip(self.packagefiles_tv, "") + self.packagefiles_tv.connect("motion-notify-event", self.treeViewTooltip, tips, 0) + self.packagefiles_tv.set_events(gtk.gdk.POINTER_MOTION_MASK) self.vbox.add(self.textWindow)
Signature · 1 line
1.8.1.2
PATCH 3/3 hob: fix package property dialog for changes to FILES_INFO
In reply to Paul EggletonThe FILES_INFO structure is now much simpler, so remove all of the horrible mangling we had to do here in order to read it.
--- lib/bb/ui/crumbs/hig/propertydialog.py | 44 ++++++++++++---------------------- 1 file changed, 15 insertions(+), 29 deletions(-)
lib/bb/ui/crumbs/hig/propertydialog.py +15 -29
@@ -105,13 +105,14 @@ class PropertyDialog(CrumbsDialog): def create_package_visual_elements(self): + import json + name = self.properties['name'] binb = self.properties['binb'] size = self.properties['size'] recipe = self.properties['recipe'] - file_list = self.properties['files_list'] + file_list = json.loads(self.properties['files_list']) - file_list = file_list.strip("{}'") files_temp = '' paths_temp = '' files_binb = []
@@ -180,7 +181,7 @@ class PropertyDialog(CrumbsDialog): #################################### FILES BROUGHT BY PACKAGES ################################### - if file_list != '': + if file_list: self.textWindow = gtk.ScrolledWindow() self.textWindow.set_shadow_type(gtk.SHADOW_IN)
@@ -199,33 +200,18 @@ class PropertyDialog(CrumbsDialog): col1.set_cell_data_func(self.cell1, self.regex_field) self.packagefiles_tv.append_column(col1) - for items in file_list.split(']'): - if len(items) > 1: - paths_temp = items.split(":")[0] - paths_binb.append(paths_temp.strip(" ,'")) - files_temp = items.split(":")[1] - files_binb.append(files_temp.strip(" ['")) + items = file_list.keys() + items.sort() + for item in items: + fullpath = item + while len(item) > 35: + item = item[:len(item)/2] + "" + item[len(item)/2+1:] + if len(item) == 35: + item = item[:len(item)/2] + "..." + item[len(item)/2+3:] + self.tooltip_items[item] = fullpath + + packagefiles_store.append([str(item)]) - unsorted_list = [] - - for items in range(len(paths_binb)): - if len(files_binb[items]) > 1: - for aduse in (files_binb[items].split(",")): - unsorted_list.append(paths_binb[items].split(name)[len(paths_binb[items].split(name))-1] + '/' + aduse.strip(" '")) - - - unsorted_list.sort() - for items in unsorted_list: - temp = items - while len(items) > 35: - items = items[:len(items)/2] + "" + items[len(items)/2+1:] - if len(items) == 35: - items = items[:len(items)/2] + "..." + items[len(items)/2+3:] - self.tooltip_items[items] = temp - - packagefiles_store.append([str(items)]) - - self.packagefiles_tv.set_model(packagefiles_store) tips = gtk.Tooltips()
Signature · 1 line
1.8.1.2