summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/builddetailspage.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/builddetailspage.py')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builddetailspage.py86
1 files changed, 82 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index df8304e06c..db45fe8e77 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -21,13 +21,90 @@
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 22
23import gtk 23import gtk
24import pango
25import gobject
24from bb.ui.crumbs.progressbar import HobProgressBar 26from bb.ui.crumbs.progressbar import HobProgressBar
25from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton 27from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText
26from bb.ui.crumbs.runningbuild import RunningBuildTreeView 28from bb.ui.crumbs.runningbuild import RunningBuildTreeView
27from bb.ui.crumbs.runningbuild import BuildConfigurationTreeView
28from bb.ui.crumbs.runningbuild import BuildFailureTreeView 29from bb.ui.crumbs.runningbuild import BuildFailureTreeView
29from bb.ui.crumbs.hobpages import HobPage 30from bb.ui.crumbs.hobpages import HobPage
30 31
32class BuildConfigurationTreeView(gtk.TreeView):
33 def __init__ (self):
34 gtk.TreeView.__init__(self)
35 self.set_rules_hint(False)
36 self.set_headers_visible(False)
37 self.set_property("hover-expand", True)
38 self.get_selection().set_mode(gtk.SELECTION_SINGLE)
39
40 # The icon that indicates whether we're building or failed.
41 renderer0 = gtk.CellRendererText()
42 renderer0.set_property('font-desc', pango.FontDescription('courier bold 12'))
43 col0 = gtk.TreeViewColumn ("Name", renderer0, text=0)
44 self.append_column (col0)
45
46 # The message of configuration.
47 renderer1 = HobWarpCellRendererText(col_number=1)
48 col1 = gtk.TreeViewColumn ("Values", renderer1, text=1)
49 self.append_column (col1)
50
51 def set_vars(self, key="", var=[""]):
52 d = {}
53 if type(var) == str:
54 d = {key: [var]}
55 elif type(var) == list and len(var) > 1:
56 #create the sub item line
57 l = []
58 text = ""
59 for item in var:
60 text = " - " + item
61 l.append(text)
62 d = {key: var}
63
64 return d
65
66 def set_config_model(self, show_vars):
67 listmodel = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
68 parent = None
69 for var in show_vars:
70 for subitem in var.items():
71 name = subitem[0]
72 is_parent = True
73 for value in subitem[1]:
74 if is_parent:
75 parent = listmodel.append(parent, (name, value))
76 is_parent = False
77 else:
78 listmodel.append(parent, (None, value))
79 name = " - "
80 parent = None
81 # renew the tree model after get the configuration messages
82 self.set_model(listmodel)
83
84 def show(self, src_config_info, src_params):
85 vars = []
86 vars.append(self.set_vars("BB VERSION:", src_params.bb_version))
87 vars.append(self.set_vars("TARGET_ARCH:", src_params.target_arch))
88 vars.append(self.set_vars("TARGET_OS:", src_params.target_os))
89 vars.append(self.set_vars("MACHINE:", src_config_info.curr_mach))
90 vars.append(self.set_vars("DISTRO:", src_config_info.curr_distro))
91 vars.append(self.set_vars("DISTRO_VERSION:", src_params.distro_version))
92 vars.append(self.set_vars("SDK_MACHINE:", src_config_info.curr_sdk_machine))
93 vars.append(self.set_vars("TUNE_FEATURE:", src_params.tune_pkgarch))
94 vars.append(self.set_vars("LAYERS:", src_config_info.layers))
95
96 for path in src_config_info.layers:
97 import os, os.path
98 if os.path.exists(path):
99 f = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path)
100 if f:
101 branch = f.readline().lstrip('\n').rstrip('\n')
102 vars.append(self.set_vars("BRANCH:", branch))
103 f.close()
104 break
105
106 self.set_config_model(vars)
107
31# 108#
32# BuildDetailsPage 109# BuildDetailsPage
33# 110#
@@ -60,8 +137,6 @@ class BuildDetailsPage (HobPage):
60 137
61 self.notebook = HobNotebook() 138 self.notebook = HobNotebook()
62 self.config_tv = BuildConfigurationTreeView() 139 self.config_tv = BuildConfigurationTreeView()
63 self.config_model = self.builder.handler.build.model.config_model()
64 self.config_tv.set_model(self.config_model)
65 self.scrolled_view_config = gtk.ScrolledWindow () 140 self.scrolled_view_config = gtk.ScrolledWindow ()
66 self.scrolled_view_config.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS) 141 self.scrolled_view_config.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
67 self.scrolled_view_config.add(self.config_tv) 142 self.scrolled_view_config.add(self.config_tv)
@@ -161,3 +236,6 @@ class BuildDetailsPage (HobPage):
161 self.endpath = path 236 self.endpath = path
162 if v_adj.value == (v_adj.upper - v_adj.page_size): # check the gtk.adjustment position is at end boundary or not 237 if v_adj.value == (v_adj.upper - v_adj.page_size): # check the gtk.adjustment position is at end boundary or not
163 treeview.scroll_to_cell(path) 238 treeview.scroll_to_cell(path)
239
240 def show_configurations(self, configurations, params):
241 self.config_tv.show(configurations, params)