diff options
author | Joshua Lock <josh@linux.intel.com> | 2012-04-03 17:35:41 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-04-05 14:01:28 +0100 |
commit | a84e35328205ddf64bdd526741e73ba1b7e5fdf1 (patch) | |
tree | 66140b4d6103d560c69ea324d3c325e776bb9018 /bitbake/lib/bb | |
parent | d2402f6c8ed7c194fe883f53fbf0c8cbec40ecb5 (diff) | |
download | 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')
-rwxr-xr-x | bitbake/lib/bb/ui/hob.py | 13 |
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 | ||
23 | import gobject | ||
24 | import gtk | ||
25 | import sys | 23 | import sys |
26 | import os | 24 | import os |
25 | requirements = "FATAL: pygtk (version 2.22.0 or later) and pygobject are required to use Hob" | ||
26 | try: | ||
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])) | ||
34 | except ImportError as exc: | ||
35 | sys.exit("%s (%s)." % (requirements, str(exc))) | ||
27 | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) | 36 | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) |
28 | try: | 37 | try: |
29 | import bb | 38 | import bb |