Patchwork [bitbake-devel,4/6] propertydialog.py : added 'Package files' functionality

login
register
mail settings
Submitter Andrei Dinu
Date March 27, 2013, 10:27 a.m.
Message ID <1364380074-16382-5-git-send-email-andrei.adrianx.dinu@intel.com>
Download mbox | patch
Permalink /patch/47025/
State New
Headers show

Comments

Andrei Dinu - March 27, 2013, 10:27 a.m.
Extended the packages page information with the
listing of the files brought in by every package.

Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hig/propertydialog.py |   59 +++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py b/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
index 4420f97..ff4032d 100644
--- a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
+++ b/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
@@ -45,7 +45,7 @@  class PropertyDialog(CrumbsDialog):
 
                 if len(self.properties) == 10:
 		        self.create_recipe_visual_elements()
-                elif len(self.properties) == 4:
+                elif len(self.properties) == 5:
                         self.create_package_visual_elements()
                 else:
                         self.create_information_visual_elements()
@@ -93,6 +93,14 @@  class PropertyDialog(CrumbsDialog):
                 binb = self.properties['binb']
                 size = self.properties['size']
                 recipe = self.properties['recipe']
+                file_list = self.properties['files_list']
+
+                file_list = file_list.strip("{}'")
+                files_temp = ''
+                paths_temp = ''
+                files_binb = []
+                paths_binb = []
+                
 
                 #cleaning out the recipe variable
                 recipe = recipe.split("+")[0]
@@ -151,8 +159,57 @@  class PropertyDialog(CrumbsDialog):
                         self.vbox.add(self.label_short)
                         self.vbox.add(self.label_info)
 
+                #################################### FILES BROUGHT BY PACKAGES ###################################
+
+                if file_list != '':
+                
+                        self.textWindow = gtk.ScrolledWindow()
+                        self.textWindow.set_shadow_type(gtk.SHADOW_IN)
+                        self.textWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+                        self.textWindow.set_size_request(100, 170)
+
+                        sstatemirrors_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.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)
+
+                        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(" ['"))
+
+                        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:
+                                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:] 
+                                sstatemirrors_store.append([str(items)])
+
+                        self.sstatemirrors_tv.set_model(sstatemirrors_store)  
+                        self.vbox.add(self.textWindow)                                      
+
                 self.vbox.show_all()
 
+        def regex_field(self, column, cell, model, iter):
+                cell.set_property('text', model.get_value(iter, 0))
+                return
 
 	def create_recipe_visual_elements(self):