From 572851887e30fdc10c7a06ed9491f3bb0215c00f Mon Sep 17 00:00:00 2001 From: Cristiana Voicu Date: Fri, 7 Sep 2012 15:00:11 +0300 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/builder.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bitbake') 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 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 @@ -458,8 +459,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 -- cgit v1.2.3-54-g00ecf