diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builddetailspage.py | 86 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 6 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/runningbuild.py | 33 |
4 files changed, 95 insertions, 37 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 | ||
23 | import gtk | 23 | import gtk |
24 | import pango | ||
25 | import gobject | ||
24 | from bb.ui.crumbs.progressbar import HobProgressBar | 26 | from bb.ui.crumbs.progressbar import HobProgressBar |
25 | from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton | 27 | from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText |
26 | from bb.ui.crumbs.runningbuild import RunningBuildTreeView | 28 | from bb.ui.crumbs.runningbuild import RunningBuildTreeView |
27 | from bb.ui.crumbs.runningbuild import BuildConfigurationTreeView | ||
28 | from bb.ui.crumbs.runningbuild import BuildFailureTreeView | 29 | from bb.ui.crumbs.runningbuild import BuildFailureTreeView |
29 | from bb.ui.crumbs.hobpages import HobPage | 30 | from bb.ui.crumbs.hobpages import HobPage |
30 | 31 | ||
32 | class 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) | ||
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index d6c638f28d..93b8fd0d17 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
@@ -140,6 +140,12 @@ class Parameters: | |||
140 | self.runnable_machine_patterns = params["runnable_machine_patterns"].split() | 140 | self.runnable_machine_patterns = params["runnable_machine_patterns"].split() |
141 | self.deployable_image_types = params["deployable_image_types"].split() | 141 | self.deployable_image_types = params["deployable_image_types"].split() |
142 | self.tmpdir = params["tmpdir"] | 142 | self.tmpdir = params["tmpdir"] |
143 | self.distro_version = params["distro_version"] | ||
144 | self.target_os = params["target_os"] | ||
145 | self.target_arch = params["target_arch"] | ||
146 | self.tune_pkgarch = params["tune_pkgarch"] | ||
147 | self.bb_version = params["bb_version"] | ||
148 | self.tune_arch = params["tune_arch"] | ||
143 | 149 | ||
144 | class Builder(gtk.Window): | 150 | class Builder(gtk.Window): |
145 | 151 | ||
@@ -546,6 +552,7 @@ class Builder(gtk.Window): | |||
546 | self.build_details_page.update_progress_bar("Build Started: ", fraction) | 552 | self.build_details_page.update_progress_bar("Build Started: ", fraction) |
547 | self.build_details_page.reset_build_status() | 553 | self.build_details_page.reset_build_status() |
548 | self.build_details_page.reset_issues() | 554 | self.build_details_page.reset_issues() |
555 | self.build_details_page.show_configurations(self.configuration, self.parameters) | ||
549 | 556 | ||
550 | def build_succeeded(self): | 557 | def build_succeeded(self): |
551 | if self.current_step == self.FAST_IMAGE_GENERATING: | 558 | if self.current_step == self.FAST_IMAGE_GENERATING: |
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index 8042fbdf59..8583fa49e5 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |||
@@ -440,4 +440,10 @@ class HobHandler(gobject.GObject): | |||
440 | params["runnable_machine_patterns"] = self.server.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or "" | 440 | params["runnable_machine_patterns"] = self.server.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or "" |
441 | params["deployable_image_types"] = self.server.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or "" | 441 | params["deployable_image_types"] = self.server.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or "" |
442 | params["tmpdir"] = self.server.runCommand(["getVariable", "TMPDIR"]) or "" | 442 | params["tmpdir"] = self.server.runCommand(["getVariable", "TMPDIR"]) or "" |
443 | params["distro_version"] = self.server.runCommand(["getVariable", "DISTRO_VERSION"]) or "" | ||
444 | params["target_os"] = self.server.runCommand(["getVariable", "TARGET_OS"]) or "" | ||
445 | params["target_arch"] = self.server.runCommand(["getVariable", "TARGET_ARCH"]) or "" | ||
446 | params["tune_pkgarch"] = self.server.runCommand(["getVariable", "TUNE_PKGARCH"]) or "" | ||
447 | params["bb_version"] = self.server.runCommand(["getVariable", "BB_MIN_VERSION"]) or "" | ||
448 | params["tune_arch"] = self.server.runCommand(["getVariable", "TUNE_ARCH"]) or "" | ||
443 | return params | 449 | return params |
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index aecfadfb34..102cc7dc86 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py | |||
@@ -42,14 +42,6 @@ class RunningBuildModel (gtk.TreeStore): | |||
42 | gobject.TYPE_STRING, | 42 | gobject.TYPE_STRING, |
43 | gobject.TYPE_INT) | 43 | gobject.TYPE_INT) |
44 | 44 | ||
45 | def config_model_filter(self, model, it): | ||
46 | msg = model.get(it, self.COL_MESSAGE)[0] | ||
47 | if not msg or type(msg) != str: | ||
48 | return False | ||
49 | if msg.startswith("\nOE Build Configuration:\n"): | ||
50 | return True | ||
51 | return False | ||
52 | |||
53 | def failure_model_filter(self, model, it): | 45 | def failure_model_filter(self, model, it): |
54 | color = model.get(it, self.COL_COLOR)[0] | 46 | color = model.get(it, self.COL_COLOR)[0] |
55 | if not color: | 47 | if not color: |
@@ -58,11 +50,6 @@ class RunningBuildModel (gtk.TreeStore): | |||
58 | return True | 50 | return True |
59 | return False | 51 | return False |
60 | 52 | ||
61 | def config_model(self): | ||
62 | model = self.filter_new() | ||
63 | model.set_visible_func(self.config_model_filter) | ||
64 | return model | ||
65 | |||
66 | def failure_model(self): | 53 | def failure_model(self): |
67 | model = self.filter_new() | 54 | model = self.filter_new() |
68 | model.set_visible_func(self.failure_model_filter) | 55 | model.set_visible_func(self.failure_model_filter) |
@@ -75,7 +62,6 @@ class RunningBuildModel (gtk.TreeStore): | |||
75 | def close_task_refresh(self): | 62 | def close_task_refresh(self): |
76 | self.foreach(self.foreach_cell_func, None) | 63 | self.foreach(self.foreach_cell_func, None) |
77 | 64 | ||
78 | |||
79 | class RunningBuild (gobject.GObject): | 65 | class RunningBuild (gobject.GObject): |
80 | __gsignals__ = { | 66 | __gsignals__ = { |
81 | 'build-started' : (gobject.SIGNAL_RUN_LAST, | 67 | 'build-started' : (gobject.SIGNAL_RUN_LAST, |
@@ -422,25 +408,6 @@ class RunningBuildTreeView (gtk.TreeView): | |||
422 | 408 | ||
423 | self._add_to_clipboard(message) | 409 | self._add_to_clipboard(message) |
424 | 410 | ||
425 | |||
426 | class BuildConfigurationTreeView(gtk.TreeView): | ||
427 | |||
428 | def __init__ (self): | ||
429 | gtk.TreeView.__init__(self) | ||
430 | self.set_rules_hint(False) | ||
431 | self.set_headers_visible(False) | ||
432 | self.set_property("hover-expand", True) | ||
433 | self.get_selection().set_mode(gtk.SELECTION_SINGLE) | ||
434 | |||
435 | # The message of the build. | ||
436 | self.message_renderer = HobWarpCellRendererText (col_number=0) | ||
437 | self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=RunningBuildModel.COL_MESSAGE, background=RunningBuildModel.COL_COLOR) | ||
438 | font = self.get_style().font_desc | ||
439 | font.set_size(pango.SCALE * 13) | ||
440 | self.message_renderer.set_property('font-desc', font) | ||
441 | self.append_column (self.message_column) | ||
442 | |||
443 | |||
444 | class BuildFailureTreeView(gtk.TreeView): | 411 | class BuildFailureTreeView(gtk.TreeView): |
445 | 412 | ||
446 | def __init__ (self): | 413 | def __init__ (self): |