* [PATCH] hob: print message when DISPLAY is not set
@ 2012-09-07 12:00 Cristiana Voicu
2012-09-07 13:47 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Cristiana Voicu @ 2012-09-07 12:00 UTC (permalink / raw)
To: bitbake-devel
If DISPLAY wasn't set, launching hob has printed a traceback
difficult to understand. Now, the exception is caught and it
shows a human message.
[YOCTO #2596]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
bitbake/lib/bb/ui/crumbs/builder.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 7de4798..f9e54a8 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -28,6 +28,7 @@ import subprocess
import shlex
import re
import logging
+import sys
from bb.ui.crumbs.template import TemplateMgr
from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage
from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage
@@ -457,8 +458,14 @@ class Builder(gtk.Window):
self.set_title("Hob")
self.set_icon_name("applications-development")
self.set_resizable(True)
- window_width = self.get_screen().get_width()
- window_height = self.get_screen().get_height()
+
+ try:
+ window_width = self.get_screen().get_width()
+ window_height = self.get_screen().get_height()
+ except AttributeError:
+ print "Please set DISPLAY variable before running Hob."
+ sys.exit(1)
+
if window_width >= hwc.MAIN_WIN_WIDTH:
window_width = hwc.MAIN_WIN_WIDTH
window_height = hwc.MAIN_WIN_HEIGHT
@@ -1334,4 +1341,4 @@ class Builder(gtk.Window):
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
self.consolelog.setFormatter(format)
- self.logger.addHandler(self.consolelog)
\ No newline at end of file
+ self.logger.addHandler(self.consolelog)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hob: print message when DISPLAY is not set
2012-09-07 12:00 [PATCH] hob: print message when DISPLAY is not set Cristiana Voicu
@ 2012-09-07 13:47 ` Richard Purdie
0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2012-09-07 13:47 UTC (permalink / raw)
To: Cristiana Voicu; +Cc: bitbake-devel
On Fri, 2012-09-07 at 15:00 +0300, Cristiana Voicu wrote:
> If DISPLAY wasn't set, launching hob has printed a traceback
> difficult to understand. Now, the exception is caught and it
> shows a human message.
>
> [YOCTO #2596]
>
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
> bitbake/lib/bb/ui/crumbs/builder.py | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
Merged to master, thanks.
> diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
> index 7de4798..f9e54a8 100755
> --- a/bitbake/lib/bb/ui/crumbs/builder.py
> +++ b/bitbake/lib/bb/ui/crumbs/builder.py
> @@ -1334,4 +1341,4 @@ class Builder(gtk.Window):
> format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
> self.consolelog.setFormatter(format)
>
> - self.logger.addHandler(self.consolelog)
> \ No newline at end of file
> + self.logger.addHandler(self.consolelog)
I keep seeing this piece in your patches which doesn't seem to want to
apply and the line ending looks correct in the main repository. Can you
see if there is some problem locally?
Cheers,
Richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-07 13:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07 12:00 [PATCH] hob: print message when DISPLAY is not set Cristiana Voicu
2012-09-07 13:47 ` Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.