summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2012-04-03 17:35:41 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-05 14:01:28 +0100
commita84e35328205ddf64bdd526741e73ba1b7e5fdf1 (patch)
tree66140b4d6103d560c69ea324d3c325e776bb9018 /bitbake/lib/bb
parentd2402f6c8ed7c194fe883f53fbf0c8cbec40ecb5 (diff)
downloadpoky-a84e35328205ddf64bdd526741e73ba1b7e5fdf1.tar.gz
lib/bb/ui/hob: exit cleanly if the required pygtk version isn't available
Hob uses API from pygtk 2.22, therefore check to see whether this version is available and exit cleanly if not. (Bitbake rev: 192d5fdf9ea27cdc8b043204857ae5b21173a011) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rwxr-xr-xbitbake/lib/bb/ui/hob.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index e72ab23e35..1321ebbac7 100755
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -20,10 +20,19 @@
20# with this program; if not, write to the Free Software Foundation, Inc., 20# with this program; if not, write to the Free Software Foundation, Inc.,
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 22
23import gobject
24import gtk
25import sys 23import sys
26import os 24import os
25requirements = "FATAL: pygtk (version 2.22.0 or later) and pygobject are required to use Hob"
26try:
27 import gobject
28 import gtk
29 import pygtk
30 pygtk.require('2.0') # to be certain we don't have gtk+ 1.x !?!
31 ver = gtk.pygtk_version
32 if ver < (2, 22, 0):
33 sys.exit("%s (you have pygtk %s.%s.%s)." % (requirements, ver[0], ver[1], ver[2]))
34except ImportError as exc:
35 sys.exit("%s (%s)." % (requirements, str(exc)))
27sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) 36sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
28try: 37try:
29 import bb 38 import bb