* [PATCH 0/2] Hob: bug-fixes
@ 2012-05-30 12:01 Liming An
2012-05-30 16:19 ` Richard Purdie
0 siblings, 1 reply; 7+ messages in thread
From: Liming An @ 2012-05-30 12:01 UTC (permalink / raw)
To: bitbake-devel
The following changes since commit 0299499770e33e0214146132799f8779e81e581d:
ccache: Separate out into its own class (2012-05-30 12:04:49 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib limx/hob-bug-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=limx/hob-bug-fixes-continue
Liming An (2):
Hob: Fixed a compatible issue for indicator icon view
Hob: add the 'build new' be as the primary action for 'Image detail'
page
bitbake/lib/bb/ui/crumbs/hobwidget.py | 51 ++++----------------------
bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 19 ++++------
2 files changed, 16 insertions(+), 54 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] Hob: bug-fixes
2012-05-30 12:01 Liming An
@ 2012-05-30 16:19 ` Richard Purdie
0 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2012-05-30 16:19 UTC (permalink / raw)
To: Liming An; +Cc: bitbake-devel
On Wed, 2012-05-30 at 20:01 +0800, Liming An wrote:
> The following changes since commit 0299499770e33e0214146132799f8779e81e581d:
>
> ccache: Separate out into its own class (2012-05-30 12:04:49 +0100)
>
> are available in the git repository at:
> git://git.pokylinux.org/poky-contrib limx/hob-bug-fixes-continue
> http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=limx/hob-bug-fixes-continue
>
> Liming An (2):
> Hob: Fixed a compatible issue for indicator icon view
> Hob: add the 'build new' be as the primary action for 'Image detail'
> page
Merged to master, thanks.
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/2] Hob: bug-fixes
@ 2012-06-14 12:21 Liming An
2012-06-14 12:55 ` Richard Purdie
0 siblings, 1 reply; 7+ messages in thread
From: Liming An @ 2012-06-14 12:21 UTC (permalink / raw)
To: bitbake-devel
The following changes since commit 7f017cab0b3e4d5a4fc356eccd8eb8429b0531d0:
connman: bump PR and add some comments (2012-06-13 13:11:23 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib limx/hob-bug-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=limx/hob-bug-fixes-continue
Liming An (2):
Hob: fixed an issue about no 'set_page' function in hob failed page
show
Hob: fixed issue about 'select a base image' combo not sensitive
bitbake/lib/bb/ui/crumbs/builder.py | 2 ++
bitbake/lib/bb/ui/crumbs/hobwidget.py | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] Hob: bug-fixes
2012-06-14 12:21 [PATCH 0/2] Hob: bug-fixes Liming An
@ 2012-06-14 12:55 ` Richard Purdie
0 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2012-06-14 12:55 UTC (permalink / raw)
To: Liming An; +Cc: bitbake-devel
On Thu, 2012-06-14 at 20:21 +0800, Liming An wrote:
> The following changes since commit 7f017cab0b3e4d5a4fc356eccd8eb8429b0531d0:
>
> connman: bump PR and add some comments (2012-06-13 13:11:23 +0100)
>
> are available in the git repository at:
> git://git.pokylinux.org/poky-contrib limx/hob-bug-fixes-continue
> http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=limx/hob-bug-fixes-continue
>
> Liming An (2):
> Hob: fixed an issue about no 'set_page' function in hob failed page
> show
> Hob: fixed issue about 'select a base image' combo not sensitive
Merged to master, thanks.
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/2] hob:bug-fixes
@ 2012-08-02 11:05 Liming An
2012-08-02 11:06 ` [PATCH 1/2] Hob: log for Hob and allow users to show logs after successful build Liming An
2012-08-02 11:06 ` [PATCH 2/2] Hob: change the Build failure scenario as ui design Liming An
0 siblings, 2 replies; 7+ messages in thread
From: Liming An @ 2012-08-02 11:05 UTC (permalink / raw)
To: bitbake-devel
The following changes since commit 62d42fe3cfa575cb97b484ccf7b2e9a25cc50770:
tiny-init: Setup /dev/ptmx in init (2012-08-01 23:11:18 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib limx/hob-bug-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=limx/hob-bug-fixes-continue
Liming An (2):
Hob: log for Hob and allow users to show logs after successful build
Hob: change the Build failure scenario as ui design
bitbake/lib/bb/ui/crumbs/builddetailspage.py | 83 +++++++++-------------
bitbake/lib/bb/ui/crumbs/builder.py | 52 +++++++++++---
bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 3 +
bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 24 +++++-
bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 27 ++++++-
bitbake/lib/bb/ui/crumbs/runningbuild.py | 41 +++++++++++
6 files changed, 162 insertions(+), 68 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] Hob: log for Hob and allow users to show logs after successful build
2012-08-02 11:05 [PATCH 0/2] hob:bug-fixes Liming An
@ 2012-08-02 11:06 ` Liming An
2012-08-02 11:06 ` [PATCH 2/2] Hob: change the Build failure scenario as ui design Liming An
1 sibling, 0 replies; 7+ messages in thread
From: Liming An @ 2012-08-02 11:06 UTC (permalink / raw)
To: bitbake-devel
If users build images in Hob, record logs and allow users to retrieve the lo
after successful build.
The logs are generated if and only if:
- users do "just bake"
- users do "build image" after "build packages"
- users do "build packages" only
[YOCTO #1991]
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Liming An <limingx.l.an@intel.com>
---
bitbake/lib/bb/ui/crumbs/builder.py | 52 +++++++++++++++++----
bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 3 +
bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 24 ++++++++--
bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 27 ++++++++++--
bitbake/lib/bb/ui/crumbs/runningbuild.py | 41 +++++++++++++++++
5 files changed, 129 insertions(+), 18 deletions(-)
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 123608e..6e5e532 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -27,6 +27,7 @@ import os
import subprocess
import shlex
import re
+import logging
from bb.ui.crumbs.template import TemplateMgr
from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage
from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage
@@ -395,6 +396,11 @@ class Builder(gtk.Window):
self.template = None
+ # logger
+ self.logger = logging.getLogger("BitBake")
+ self.consolelog = None
+ self.current_logfile = None
+
# configuration and parameters
self.configuration = Configuration()
self.parameters = Parameters()
@@ -432,6 +438,7 @@ class Builder(gtk.Window):
self.handler.build.connect("build-failed", self.handler_build_failed_cb)
self.handler.build.connect("task-started", self.handler_task_started_cb)
self.handler.build.connect("log-error", self.handler_build_failure_cb)
+ self.handler.build.connect("log", self.handler_build_log_cb)
self.handler.build.connect("no-provider", self.handler_no_provider_cb)
self.handler.connect("generating-data", self.handler_generating_data_cb)
self.handler.connect("data-generated", self.handler_data_generated_cb)
@@ -500,25 +507,34 @@ class Builder(gtk.Window):
self.set_user_config()
self.handler.generate_recipes()
- def generate_packages_async(self):
+ def generate_packages_async(self, log = False):
self.switch_page(self.PACKAGE_GENERATING)
+ if log:
+ self.current_logfile = self.handler.get_logfile()
+ self.do_log(self.current_logfile)
# Build packages
_, all_recipes = self.recipe_model.get_selected_recipes()
self.set_user_config()
self.handler.reset_build()
self.handler.generate_packages(all_recipes, self.configuration.default_task)
- def fast_generate_image_async(self):
+ def fast_generate_image_async(self, log = False):
self.switch_page(self.FAST_IMAGE_GENERATING)
+ if log:
+ self.current_logfile = self.handler.get_logfile()
+ self.do_log(self.current_logfile)
# Build packages
_, all_recipes = self.recipe_model.get_selected_recipes()
self.set_user_config()
self.handler.reset_build()
self.handler.generate_packages(all_recipes, self.configuration.default_task)
- def generate_image_async(self):
+ def generate_image_async(self, cont = False):
self.switch_page(self.IMAGE_GENERATING)
self.handler.reset_build()
+ if not cont:
+ self.current_logfile = self.handler.get_logfile()
+ self.do_log(self.current_logfile)
# Build image
self.set_user_config()
toolchain_packages = []
@@ -626,14 +642,14 @@ class Builder(gtk.Window):
pass
elif next_step == self.PACKAGE_SELECTION:
- pass
+ self.package_details_page.show_page(self.current_logfile)
elif next_step == self.PACKAGE_GENERATING or next_step == self.FAST_IMAGE_GENERATING:
# both PACKAGE_GENEATING and FAST_IMAGE_GENERATING share the same page
self.build_details_page.show_page(next_step)
elif next_step == self.PACKAGE_GENERATED:
- pass
+ self.package_details_page.show_page(self.current_logfile)
elif next_step == self.IMAGE_GENERATING:
# after packages are generated, selected_packages need to
@@ -735,7 +751,7 @@ class Builder(gtk.Window):
self.rcppkglist_populated()
if self.current_step == self.FAST_IMAGE_GENERATING:
- self.generate_image_async()
+ self.generate_image_async(True)
def show_error_dialog(self, msg):
lbl = "<b>Error</b>\n"
@@ -959,6 +975,10 @@ class Builder(gtk.Window):
def handler_build_failure_cb(self, running_build):
self.build_details_page.show_issues()
+ def handler_build_log_cb(self, running_build, func, obj):
+ if hasattr(self.logger, func):
+ getattr(self.logger, func)(obj)
+
def destroy_window_cb(self, widget, event):
if not self.sensitive:
return True
@@ -988,7 +1008,7 @@ class Builder(gtk.Window):
dialog.run()
dialog.destroy()
return
- self.generate_packages_async()
+ self.generate_packages_async(True)
def build_image(self):
selected_packages = self.package_model.get_selected_packages()
@@ -1001,7 +1021,7 @@ class Builder(gtk.Window):
dialog.run()
dialog.destroy()
return
- self.generate_image_async()
+ self.generate_image_async(True)
def just_bake(self):
selected_image = self.recipe_model.get_selected_image()
@@ -1018,7 +1038,7 @@ class Builder(gtk.Window):
dialog.destroy()
return
- self.fast_generate_image_async()
+ self.fast_generate_image_async(True)
def show_binb_dialog(self, binb):
markup = "<b>Brought in by:</b>\n%s" % binb
@@ -1237,7 +1257,7 @@ class Builder(gtk.Window):
response = dialog.run()
dialog.destroy()
if response == gtk.RESPONSE_YES:
- self.generate_packages_async()
+ self.generate_packages_async(True)
else:
self.switch_page(self.PACKAGE_SELECTION)
else:
@@ -1285,3 +1305,15 @@ class Builder(gtk.Window):
self.cancel_build_sync()
elif response == gtk.RESPONSE_YES:
self.cancel_build_sync(True)
+
+ def do_log(self, consolelogfile = None):
+ if consolelogfile:
+ if self.consolelog:
+ self.logger.removeHandler(self.consolelog)
+ self.consolelog = None
+ self.consolelog = logging.FileHandler(consolelogfile)
+ bb.msg.addDefaultlogFilter(self.consolelog)
+ format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ self.consolelog.setFormatter(format)
+
+ self.logger.addHandler(self.consolelog)
\ No newline at end of file
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index a00fcd8..540dde0 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -390,6 +390,9 @@ class HobHandler(gobject.GObject):
def reset_build(self):
self.build.reset()
+ def get_logfile(self):
+ return self.server.runCommand(["getVariable", "BB_CONSOLELOG"])
+
def _remove_redundant(self, string):
ret = []
for i in string.split():
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index 596fb85..40eb7a4 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -33,7 +33,7 @@ from bb.ui.crumbs.hig import CrumbsDialog
class ImageDetailsPage (HobPage):
class DetailBox (gtk.EventBox):
- def __init__(self, widget = None, varlist = None, vallist = None, icon = None, button = None, color = HobColors.LIGHT_GRAY):
+ def __init__(self, widget = None, varlist = None, vallist = None, icon = None, button = None, button2=None, color = HobColors.LIGHT_GRAY):
gtk.EventBox.__init__(self)
# set color
@@ -72,7 +72,11 @@ class ImageDetailsPage (HobPage):
self.table.attach(self.line_widgets[varlist[index]], colid, 20, row, row + 1)
# pack the button on the right
if button:
- self.hbox.pack_end(button, expand=False, fill=False)
+ self.bbox = gtk.VBox()
+ self.bbox.pack_start(button, expand=True, fill=True)
+ if button2:
+ self.bbox.pack_start(button2, expand=True, fill=True)
+ self.hbox.pack_end(self.bbox, expand=False, fill=False)
def update_line_widgets(self, variable, value):
if len(self.line_widgets) == 0:
@@ -164,8 +168,10 @@ class ImageDetailsPage (HobPage):
base_image = self.builder.recipe_model.get_selected_image()
layers = self.builder.configuration.layers
pkg_num = "%s" % len(self.builder.package_model.get_selected_packages())
+ log_file = self.builder.current_logfile
else:
pkg_num = "N/A"
+ log_file = None
# remove
for button_id, button in self.button_ids.items():
@@ -243,11 +249,17 @@ class ImageDetailsPage (HobPage):
view_files_button = HobAltButton("View files")
view_files_button.connect("clicked", self.view_files_clicked_cb, image_addr)
view_files_button.set_tooltip_text("Open the directory containing the image files")
- self.image_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=view_files_button)
+ view_log_button = None
+ if log_file:
+ view_log_button = HobAltButton("View log")
+ view_log_button.connect("clicked", self.view_log_clicked_cb, log_file)
+ view_log_button.set_tooltip_text("Open the building log files")
+ self.image_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=view_files_button, button2=view_log_button)
self.box_group_area.pack_start(self.image_detail, expand=False, fill=True)
# The default kernel box for the qemu images
self.sel_kernel = ""
+ self.kernel_detail = None
if 'qemu' in image_name:
self.sel_kernel = self.get_kernel_file_name()
@@ -315,12 +327,16 @@ class ImageDetailsPage (HobPage):
self.box_group_area.pack_start(self.details_bottom_buttons, expand=False, fill=False)
self.show_all()
- if not is_runnable:
+ if self.kernel_detail and (not is_runnable):
self.kernel_detail.hide()
def view_files_clicked_cb(self, button, image_addr):
subprocess.call("xdg-open /%s" % image_addr, shell=True)
+ def view_log_clicked_cb(self, button, log_file):
+ if log_file:
+ os.system("xdg-open /%s" % log_file)
+
def refresh_package_detail_box(self, image_size):
self.package_detail.update_line_widgets("Total image size: ", image_size)
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index 1b832eb..d101535 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -143,8 +143,8 @@ class PackageSelectionPage (HobPage):
# add all into the dialog
self.box_group_area.pack_start(self.ins, expand=True, fill=True)
- button_box = gtk.HBox(False, 6)
- self.box_group_area.pack_start(button_box, expand=False, fill=False)
+ self.button_box = gtk.HBox(False, 6)
+ self.box_group_area.pack_start(self.button_box, expand=False, fill=False)
self.build_image_button = HobButton('Build image')
self.build_image_button.set_size_request(205, 49)
@@ -152,11 +152,11 @@ class PackageSelectionPage (HobPage):
self.build_image_button.set_flags(gtk.CAN_DEFAULT)
self.build_image_button.grab_default()
self.build_image_button.connect("clicked", self.build_image_clicked_cb)
- button_box.pack_end(self.build_image_button, expand=False, fill=False)
+ self.button_box.pack_end(self.build_image_button, expand=False, fill=False)
self.back_button = HobAltButton("<< Back to image configuration")
self.back_button.connect("clicked", self.back_button_clicked_cb)
- button_box.pack_start(self.back_button, expand=False, fill=False)
+ self.button_box.pack_start(self.back_button, expand=False, fill=False)
def button_click_cb(self, widget, event):
path, col = widget.table_tree.get_cursor()
@@ -166,6 +166,25 @@ class PackageSelectionPage (HobPage):
if binb:
self.builder.show_binb_dialog(binb)
+ def view_log_clicked_cb(self, button, log_file):
+ if log_file:
+ os.system("xdg-open /%s" % log_file)
+
+ def show_page(self, log_file):
+ children = self.button_box.get_children() or []
+ for child in children:
+ self.button_box.remove(child)
+ # re-packed the buttons as request, add the 'view log' button if build success
+ self.button_box.pack_start(self.back_button, expand=False, fill=False)
+ self.button_box.pack_end(self.build_image_button, expand=False, fill=False)
+ if log_file:
+ view_log_button = HobAltButton("View log")
+ view_log_button.connect("clicked", self.view_log_clicked_cb, log_file)
+ view_log_button.set_tooltip_text("Open the building log files")
+ self.button_box.pack_end(view_log_button, expand=False, fill=False)
+
+ self.show_all()
+
def build_image_clicked_cb(self, button):
self.builder.build_image()
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
index 8cf36ee..e814830 100644
--- a/bitbake/lib/bb/ui/crumbs/runningbuild.py
+++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -85,6 +85,9 @@ class RunningBuild (gobject.GObject):
'no-provider' : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
+ 'log' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT,)),
}
pids_to_task = {}
tasks_to_iter = {}
@@ -122,6 +125,8 @@ class RunningBuild (gobject.GObject):
parent = self.tasks_to_iter[(package, task)]
if(isinstance(event, logging.LogRecord)):
+ if event.taskpid == 0 or event.levelno > logging.INFO:
+ self.emit("log", "handle", event)
# FIXME: this is a hack! More info in Yocto #1433
# http://bugzilla.pokylinux.org/show_bug.cgi?id=1433, temporarily
# mask the error message as it's not informative for the user.
@@ -207,6 +212,7 @@ class RunningBuild (gobject.GObject):
self.tasks_to_iter[(package, task)] = i
elif isinstance(event, bb.build.TaskBase):
+ self.emit("log", "info", event._message)
current = self.tasks_to_iter[(package, task)]
parent = self.tasks_to_iter[(package, None)]
@@ -287,6 +293,7 @@ class RunningBuild (gobject.GObject):
pbar.set_text(event.msg)
elif isinstance(event, bb.command.CommandFailed):
+ self.emit("log", "error", "Command execution failed: %s" % (event.error))
if event.error.startswith("Exited with"):
# If the command fails with an exit code we're done, emit the
# generic signal for the UI to notify the user
@@ -314,7 +321,24 @@ class RunningBuild (gobject.GObject):
elif isinstance(event, bb.event.ParseCompleted) and pbar:
pbar.hide()
#using runqueue events as many as possible to update the progress bar
+ elif isinstance(event, bb.runqueue.runQueueTaskFailed):
+ self.emit("log", "error", "Task %s (%s) failed with exit code '%s'" % (event.taskid, event.taskstring, event.exitcode))
+ elif isinstance(event, bb.runqueue.sceneQueueTaskFailed):
+ self.emit("log", "warn", "Setscene task %s (%s) failed with exit code '%s' - real task will be run instead" \
+ % (event.taskid, event.taskstring, event.exitcode))
elif isinstance(event, (bb.runqueue.runQueueTaskStarted, bb.runqueue.sceneQueueTaskStarted)):
+ if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
+ self.emit("log", "info", "Running setscene task %d of %d (%s)" % \
+ (event.stats.completed + event.stats.active + event.stats.failed + 1,
+ event.stats.total, event.taskstring))
+ else:
+ if event.noexec:
+ tasktype = 'noexec task'
+ else:
+ tasktype = 'task'
+ self.emit("log", "info", "Running %s %s of %s (ID: %s, %s)" % \
+ (tasktype, event.stats.completed + event.stats.active + event.stats.failed + 1,
+ event.stats.total, event.taskid, event.taskstring))
message = {}
message["eventname"] = bb.event.getName(event)
num_of_completed = event.stats.completed + event.stats.failed
@@ -323,6 +347,10 @@ class RunningBuild (gobject.GObject):
message["title"] = ""
message["task"] = event.taskstring
self.emit("task-started", message)
+ elif isinstance(event, bb.event.MultipleProviders):
+ self.emit("log", "info", "multiple providers are available for %s%s (%s)" \
+ % (event._is_runtime and "runtime " or "", event._item, ", ".join(event._candidates)))
+ self.emit("log", "info", "consider defining a PREFERRED_PROVIDER entry to match %s" % (event._item))
elif isinstance(event, bb.event.NoProvider):
msg = ""
if event._runtime:
@@ -337,6 +365,19 @@ class RunningBuild (gobject.GObject):
for reason in event._reasons:
msg += ("%s\n" % reason)
self.emit("no-provider", msg)
+ self.emit("log", msg)
+ else:
+ if not isinstance(event, (bb.event.BuildBase,
+ bb.event.StampUpdate,
+ bb.event.ConfigParsed,
+ bb.event.RecipeParsed,
+ bb.event.RecipePreFinalise,
+ bb.runqueue.runQueueEvent,
+ bb.runqueue.runQueueExitWait,
+ bb.event.OperationStarted,
+ bb.event.OperationCompleted,
+ bb.event.OperationProgress)):
+ self.emit("log", "error", "Unknown event: %s" % (event.error if hasattr(event, 'error') else 'error'))
return
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] Hob: change the Build failure scenario as ui design
2012-08-02 11:05 [PATCH 0/2] hob:bug-fixes Liming An
2012-08-02 11:06 ` [PATCH 1/2] Hob: log for Hob and allow users to show logs after successful build Liming An
@ 2012-08-02 11:06 ` Liming An
1 sibling, 0 replies; 7+ messages in thread
From: Liming An @ 2012-08-02 11:06 UTC (permalink / raw)
To: bitbake-devel
As ui design 'build-fail-spec.pdf' to change the GUI
[YOCTO #2183]
Signed-off-by: Liming An <limingx.l.an@intel.com>
---
bitbake/lib/bb/ui/crumbs/builddetailspage.py | 83 ++++++++++---------------
1 files changed, 33 insertions(+), 50 deletions(-)
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index b1afe10..30eab29 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -25,7 +25,7 @@ import pango
import gobject
import bb.process
from bb.ui.crumbs.progressbar import HobProgressBar
-from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText, HobButton
+from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText, HobButton, HobInfoButton
from bb.ui.crumbs.runningbuild import RunningBuildTreeView
from bb.ui.crumbs.runningbuild import BuildFailureTreeView
from bb.ui.crumbs.hobpages import HobPage
@@ -199,68 +199,51 @@ class BuildDetailsPage (HobPage):
for child in children:
self.remove(child)
- def update_failures_sum_display(self):
- num = 0
- it = self.failure_model.get_iter_first()
- while it:
- color = self.failure_model.get_value(it, self.builder.handler.build.model.COL_COLOR)
- if color == HobColors.ERROR:
- num += 1
- it = self.failure_model.iter_next(it)
-
- return num
-
- def add_build_fail_top_bar(self, actions):
- mainly_action = "Edit %s" % actions
- if 'image' in actions:
- next_action = ""
- else:
- next_action = "Create new image"
+ def add_build_fail_top_bar(self, actions, log_file=None):
+ primary_action = "Edit %s" % actions
- #set to issue page
self.notebook.set_page("Issues")
color = HobColors.ERROR
build_fail_top = gtk.EventBox()
- build_fail_top.set_size_request(-1, 260)
+ build_fail_top.set_size_request(-1, 200)
build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))
- build_fail_tab = gtk.Table(7, 40, True)
+ build_fail_tab = gtk.Table(14, 46, True)
build_fail_top.add(build_fail_tab)
icon = gtk.Image()
icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INDI_ERROR_FILE)
icon.set_from_pixbuf(icon_pix_buffer)
- build_fail_tab.attach(icon, 1, 4, 0, 3)
+ build_fail_tab.attach(icon, 1, 4, 0, 6)
label = gtk.Label()
label.set_alignment(0.0, 0.5)
- label.set_markup("<span size='x-large'>%s</span>" % self.title)
- build_fail_tab.attach(label, 4, 20, 0, 3)
+ label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title)
+ build_fail_tab.attach(label, 4, 26, 0, 6)
label = gtk.Label()
label.set_alignment(0.0, 0.5)
- num_of_fails = self.update_failures_sum_display()
- current_fail, recipe_task_status = self.task_status.get_text().split('\n')
- label.set_markup(" %d tasks failed, %s, %s" % (num_of_fails, current_fail, recipe_task_status))
- build_fail_tab.attach(label, 4, 40, 2, 4)
+ label.set_markup("<span size='medium'>Check the \"Issues\" information for more details</span>")
+ build_fail_tab.attach(label, 4, 40, 4, 9)
# create button 'Edit packages'
- action_button = HobButton(mainly_action)
- action_button.set_size_request(-1, 49)
- action_button.connect('clicked', self.failure_main_action_button_clicked_cb, mainly_action)
- build_fail_tab.attach(action_button, 4, 16, 4, 6)
-
- if next_action:
- next_button = HobAltButton(next_action)
- next_button.set_alignment(0.0, 0.5)
- next_button.connect('clicked', self.failure_next_action_button_clicked_cb, next_action)
- build_fail_tab.attach(next_button, 17, 24, 4, 5)
-
+ action_button = HobButton(primary_action)
+ action_button.set_size_request(-1, 40)
+ action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action)
+ build_fail_tab.attach(action_button, 4, 13, 9, 12)
+
+ if log_file:
+ open_log_button = HobAltButton("Open log")
+ open_log_button.set_relief(gtk.RELIEF_HALF)
+ open_log_button.connect('clicked', self.failure_open_log_button_clicked_cb, log_file)
+ build_fail_tab.attach(open_log_button, 14, 23, 9, 12)
+
+ attach_pos = (24 if log_file else 14)
file_bug_button = HobAltButton('File a bug')
- file_bug_button.set_alignment(0.0, 0.5)
- file_bug_button.connect('clicked', self.failure_file_bug_activate_link_cb)
- build_fail_tab.attach(file_bug_button, 17, 24, 4 + abs(next_action != ""), 6)
+ file_bug_button.set_relief(gtk.RELIEF_HALF)
+ file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb)
+ build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12)
return build_fail_top
@@ -268,10 +251,10 @@ class BuildDetailsPage (HobPage):
self._remove_all_widget()
self.title = "Hob cannot build your %s" % title
- self.build_fail_bar = self.add_build_fail_top_bar(action_names)
- self.pack_start(self.build_fail_bar)
- self.pack_start(self.group_align, expand=True, fill=True)
+ self.build_fail_bar = self.add_build_fail_top_bar(action_names, self.builder.current_logfile)
+ self.pack_start(self.group_align, expand=True, fill=True)
+ self.box_group_area.pack_start(self.build_fail_bar, expand=False, fill=False)
self.box_group_area.pack_start(self.vbox, expand=True, fill=True)
self.vbox.pack_start(self.notebook, expand=True, fill=True)
@@ -334,7 +317,7 @@ class BuildDetailsPage (HobPage):
def show_configurations(self, configurations, params):
self.config_tv.show(configurations, params)
- def failure_main_action_button_clicked_cb(self, button, action):
+ def failure_primary_action_button_clicked_cb(self, button, action):
if "Edit recipes" in action:
self.builder.show_recipes()
elif "Edit packages" in action:
@@ -342,9 +325,9 @@ class BuildDetailsPage (HobPage):
elif "Edit image configuration" in action:
self.builder.show_configuration()
- def failure_next_action_button_clicked_cb(self, button, action):
- if "Create new image" in action:
- self.builder.initiate_new_build_async()
+ def failure_open_log_button_clicked_cb(self, button, log_file):
+ if log_file:
+ os.system("xdg-open /%s" % log_file)
- def failure_file_bug_activate_link_cb(self, button):
+ def failure_activate_file_bug_link_cb(self, button):
button.child.emit('activate-link', "http://bugzilla.yoctoproject.org")
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-08-02 11:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-02 11:05 [PATCH 0/2] hob:bug-fixes Liming An
2012-08-02 11:06 ` [PATCH 1/2] Hob: log for Hob and allow users to show logs after successful build Liming An
2012-08-02 11:06 ` [PATCH 2/2] Hob: change the Build failure scenario as ui design Liming An
-- strict thread matches above, loose matches on Subject: below --
2012-06-14 12:21 [PATCH 0/2] Hob: bug-fixes Liming An
2012-06-14 12:55 ` Richard Purdie
2012-05-30 12:01 Liming An
2012-05-30 16:19 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox