diff options
author | Cristiana Voicu <cristiana.voicu@intel.com> | 2012-09-07 15:00:11 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-07 14:43:51 +0100 |
commit | 572851887e30fdc10c7a06ed9491f3bb0215c00f (patch) | |
tree | 65da24c1e664ed084e13f60cb7fb16e962cb1ce1 /bitbake/lib/bb/ui | |
parent | 95ae927dfc8cbb0b1b8a60edb5af7c448cbc9a9e (diff) | |
download | poky-572851887e30fdc10c7a06ed9491f3bb0215c00f.tar.gz |
bitbake: hob: print message when DISPLAY is not set
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]
(Bitbake rev: a41098a2dacbd903422ccdcd1885b0f351c7ddf3)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 8405adeebb..833577fc69 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
@@ -28,6 +28,7 @@ import subprocess | |||
28 | import shlex | 28 | import shlex |
29 | import re | 29 | import re |
30 | import logging | 30 | import logging |
31 | import sys | ||
31 | from bb.ui.crumbs.template import TemplateMgr | 32 | from bb.ui.crumbs.template import TemplateMgr |
32 | from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage | 33 | from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage |
33 | from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage | 34 | from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage |
@@ -458,8 +459,14 @@ class Builder(gtk.Window): | |||
458 | self.set_title("Hob") | 459 | self.set_title("Hob") |
459 | self.set_icon_name("applications-development") | 460 | self.set_icon_name("applications-development") |
460 | self.set_resizable(True) | 461 | self.set_resizable(True) |
461 | window_width = self.get_screen().get_width() | 462 | |
462 | window_height = self.get_screen().get_height() | 463 | try: |
464 | window_width = self.get_screen().get_width() | ||
465 | window_height = self.get_screen().get_height() | ||
466 | except AttributeError: | ||
467 | print "Please set DISPLAY variable before running Hob." | ||
468 | sys.exit(1) | ||
469 | |||
463 | if window_width >= hwc.MAIN_WIN_WIDTH: | 470 | if window_width >= hwc.MAIN_WIN_WIDTH: |
464 | window_width = hwc.MAIN_WIN_WIDTH | 471 | window_width = hwc.MAIN_WIN_WIDTH |
465 | window_height = hwc.MAIN_WIN_HEIGHT | 472 | window_height = hwc.MAIN_WIN_HEIGHT |