From: Paul Eggleton Date: Mon, 2 Dec 2013 18:58:47 +0000 (+0000) Subject: bitbake: hob: fix package property dialog for changes to FILES_INFO X-Git-Tag: rev_ivi_2015_02_04~10130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e46c98e2265ae86b52ecd56a9bd77d572ac6e5b6;p=scm%2Fbb%2Ftizen-distro.git bitbake: hob: fix package property dialog for changes to FILES_INFO 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. (Bitbake rev: 11a664292064dbf76850bf21ba386f78a43a56b6) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py b/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py index 9ab7d75..09b9ce6 100644 --- a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py +++ b/bitbake/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()