summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/hob.py
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/ui/hob.py
parentd2402f6c8ed7c194fe883f53fbf0c8cbec40ecb5 (diff)
downloadast2050-yocto-poky-a84e35328205ddf64bdd526741e73ba1b7e5fdf1.zip
ast2050-yocto-poky-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/ui/hob.py')
-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 e72ab23..1321ebb 100755
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -20,10 +20,19 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import gobject
-import gtk
import sys
import os
+requirements = "FATAL: pygtk (version 2.22.0 or later) and pygobject are required to use Hob"
+try:
+ import gobject
+ import gtk
+ import pygtk
+ pygtk.require('2.0') # to be certain we don't have gtk+ 1.x !?!
+ ver = gtk.pygtk_version
+ if ver < (2, 22, 0):
+ sys.exit("%s (you have pygtk %s.%s.%s)." % (requirements, ver[0], ver[1], ver[2]))
+except ImportError as exc:
+ sys.exit("%s (%s)." % (requirements, str(exc)))
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
try:
import bb
OpenPOWER on IntegriCloud