All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] BitBake UI changes for OE-Core pkgdata improvements
@ 2013-12-02 18:58 Paul Eggleton
  2013-12-02 18:58 ` [PATCH 1/3] lib/bb/ui: handle PKGSIZE change to bytes Paul Eggleton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2013-12-02 18:58 UTC (permalink / raw)
  To: bitbake-devel

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(-)

-- 
1.8.1.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] lib/bb/ui: handle PKGSIZE change to bytes
  2013-12-02 18:58 [PATCH 0/3] BitBake UI changes for OE-Core pkgdata improvements Paul Eggleton
@ 2013-12-02 18:58 ` Paul Eggleton
  2013-12-02 18:58 ` [PATCH 2/3] hob: name package files list variables appropriately Paul Eggleton
  2013-12-02 18:58 ` [PATCH 3/3] hob: fix package property dialog for changes to FILES_INFO Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2013-12-02 18:58 UTC (permalink / raw)
  To: bitbake-devel

PKGSIZE is now in bytes in pkgdata, so we need to treat it as such in
the UI code for Hob / Toaster.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/ui/buildinfohelper.py     | 2 +-
 lib/bb/ui/crumbs/hoblistmodel.py | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 2c9d77a..61149fa 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -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'],
                                        )
diff --git a/lib/bb/ui/crumbs/hoblistmodel.py b/lib/bb/ui/crumbs/hoblistmodel.py
index 79e909c..cffe6e1 100644
--- a/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/lib/bb/ui/crumbs/hoblistmodel.py
@@ -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,
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] hob: name package files list variables appropriately
  2013-12-02 18:58 [PATCH 0/3] BitBake UI changes for OE-Core pkgdata improvements Paul Eggleton
  2013-12-02 18:58 ` [PATCH 1/3] lib/bb/ui: handle PKGSIZE change to bytes Paul Eggleton
@ 2013-12-02 18:58 ` Paul Eggleton
  2013-12-02 18:58 ` [PATCH 3/3] hob: fix package property dialog for changes to FILES_INFO Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2013-12-02 18:58 UTC (permalink / raw)
  To: bitbake-devel

This treeview code was obviously copy-pasted from one of the config
dialogs and the variables were never renamed. Rename them now to improve
readability.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/ui/crumbs/hig/propertydialog.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/bb/ui/crumbs/hig/propertydialog.py b/lib/bb/ui/crumbs/hig/propertydialog.py
index bc40741..9ab7d75 100644
--- a/lib/bb/ui/crumbs/hig/propertydialog.py
+++ b/lib/bb/ui/crumbs/hig/propertydialog.py
@@ -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)                                      
 
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] hob: fix package property dialog for changes to FILES_INFO
  2013-12-02 18:58 [PATCH 0/3] BitBake UI changes for OE-Core pkgdata improvements Paul Eggleton
  2013-12-02 18:58 ` [PATCH 1/3] lib/bb/ui: handle PKGSIZE change to bytes Paul Eggleton
  2013-12-02 18:58 ` [PATCH 2/3] hob: name package files list variables appropriately Paul Eggleton
@ 2013-12-02 18:58 ` Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2013-12-02 18:58 UTC (permalink / raw)
  To: bitbake-devel

The FILES_INFO structure is now much simpler, so remove all of the
horrible mangling we had to do here in order to read it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/ui/crumbs/hig/propertydialog.py | 44 ++++++++++++----------------------
 1 file changed, 15 insertions(+), 29 deletions(-)

diff --git a/lib/bb/ui/crumbs/hig/propertydialog.py b/lib/bb/ui/crumbs/hig/propertydialog.py
index 9ab7d75..09b9ce6 100644
--- a/lib/bb/ui/crumbs/hig/propertydialog.py
+++ b/lib/bb/ui/crumbs/hig/propertydialog.py
@@ -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()
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-02 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02 18:58 [PATCH 0/3] BitBake UI changes for OE-Core pkgdata improvements Paul Eggleton
2013-12-02 18:58 ` [PATCH 1/3] lib/bb/ui: handle PKGSIZE change to bytes Paul Eggleton
2013-12-02 18:58 ` [PATCH 2/3] hob: name package files list variables appropriately Paul Eggleton
2013-12-02 18:58 ` [PATCH 3/3] hob: fix package property dialog for changes to FILES_INFO Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.