[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.0-35-g98280a7

Sandro Tosi morph at debian.org
Fri Apr 10 21:09:51 UTC 2009


The following commit has been merged in the master branch:
commit 6cd977be37204136517accbf2d65e16388f6f2fb
Author: Luca Bruno <lethalman88 at gmail.com>
Date:   Fri Apr 10 09:58:19 2009 +0200

    Check for vte in initialize()

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 77eca3a..b3ffcb8 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -28,18 +28,7 @@ try:
 except ImportError:
     raise UINotImportable, 'Please install the python-gtk2 package to use this interface.'
 
-try:
-    import vte
-except ImportError:
-    message = "Please install the %s package to use the gtk2 interface."
-    dialog = gtk.MessageDialog (None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
-                                gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, None)
-    dialog.set_markup (message % "<b>python-vte</b>")
-    dialog.run ()
-    dialog.destroy ()
-    while gtk.events_pending ():
-        gtk.main_iteration ()
-    raise UINotImportable, message % "python-vte"
+global vte
 
 try:
     import gtkspell
@@ -1330,7 +1319,21 @@ def forward_operations (parent, operations):
         globals()[operation] = create_forwarder (parent, klass)
 
 def initialize ():
-    global application, assistant
+    global application, assistant, vte
+
+    try:
+        vte = __import__ ("vte")
+    except ImportError:
+        message = "Please install the %s package to use the gtk2 interface."
+        dialog = gtk.MessageDialog (None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+                                    gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, None)
+        dialog.set_markup (message % "<b>python-vte</b>")
+        dialog.run ()
+        dialog.destroy ()
+        while gtk.events_pending ():
+            gtk.main_iteration ()
+        sys.exit (1)
+
     # Exception hook
     oldhook = sys.excepthook
     sys.excepthook = ExceptionDialog.create_excepthook (oldhook)

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list