All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Warn users if they don't have the required modules for Hob v2
@ 2012-04-04  0:35 Joshua Lock
  2012-04-04  0:35 ` [PATCH 1/1] lib/bb/ui/hob: exit cleanly if the required pygtk version isn't available Joshua Lock
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Lock @ 2012-04-04  0:35 UTC (permalink / raw)
  To: bitbake-devel

A second version of this change, to notify the user as to the missing requirements
rather than issuing a backtrace if they don't have the right versions, or required
modules, to run hob.

Cheers,
Joshua

The following changes since commit 035e146ff92236a3eda71ad71e8389737f91753b:

  Hob: In building log page, fixed the issue about 'endpath' not clear when next to start build (2012-03-30 17:19:35 +0100)

are available in the git repository at:
  git://github.com/incandescant/bitbake josh/hob
  https://github.com/incandescant/bitbake/tree/josh/hob

Joshua Lock (1):
  lib/bb/ui/hob: exit cleanly if the required pygtk version isn't
    available

 lib/bb/ui/hob.py |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

-- 
1.7.7.6




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] lib/bb/ui/hob: exit cleanly if the required pygtk version isn't available
  2012-04-04  0:35 [PATCH 0/1] Warn users if they don't have the required modules for Hob v2 Joshua Lock
@ 2012-04-04  0:35 ` Joshua Lock
  2012-04-05 13:01   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Lock @ 2012-04-04  0:35 UTC (permalink / raw)
  To: bitbake-devel

Hob uses API from pygtk 2.22, therefore check to see whether this
version is available and exit cleanly if not.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/hob.py |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index e72ab23..1321ebb 100755
--- a/lib/bb/ui/hob.py
+++ b/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
-- 
1.7.7.6




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] lib/bb/ui/hob: exit cleanly if the required pygtk version isn't available
  2012-04-04  0:35 ` [PATCH 1/1] lib/bb/ui/hob: exit cleanly if the required pygtk version isn't available Joshua Lock
@ 2012-04-05 13:01   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-04-05 13:01 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Tue, 2012-04-03 at 17:35 -0700, Joshua Lock wrote:
> Hob uses API from pygtk 2.22, therefore check to see whether this
> version is available and exit cleanly if not.
> 
> Signed-off-by: Joshua Lock <josh@linux.intel.com>
> ---
>  lib/bb/ui/hob.py |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-05 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04  0:35 [PATCH 0/1] Warn users if they don't have the required modules for Hob v2 Joshua Lock
2012-04-04  0:35 ` [PATCH 1/1] lib/bb/ui/hob: exit cleanly if the required pygtk version isn't available Joshua Lock
2012-04-05 13:01   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.