mailr22801 - in /trunk: dep_check.py relax.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 17, 2014 - 12:47:
Author: bugman
Date: Thu Apr 17 12:47:31 2014
New Revision: 22801

URL: http://svn.gna.org/viewcvs/relax?rev=22801&view=rev
Log:
Improved error messages for when the GUI is launched but the wxPython 
installation is broken.

Now the case of a broken wxPython installation is handled rather than just a 
missing installation.
The dep_check module will store the import error message, and relax will now 
report that back to the
user.


Modified:
    trunk/dep_check.py
    trunk/relax.py

Modified: trunk/dep_check.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/dep_check.py?rev=22801&r1=22800&r2=22801&view=diff
==============================================================================
--- trunk/dep_check.py  (original)
+++ trunk/dep_check.py  Thu Apr 17 12:47:31 2014
@@ -71,6 +71,8 @@
     wx_module = True
 except ImportError:
     wx_module = False
+    message = sys.exc_info()[1]
+    wx_module_message = message.args[0]
 
 # epydoc module.
 try:

Modified: trunk/relax.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22801&r1=22800&r2=22801&view=diff
==============================================================================
--- trunk/relax.py      (original)
+++ trunk/relax.py      Thu Apr 17 12:47:31 2014
@@ -482,7 +482,13 @@
 
             # Missing wx module.
             if not dep_check.wx_module:
-                parser.error("To use the GUI, the wx python module must be 
installed.")
+                # Not installed.
+                if dep_check.wx_module_message == "No module named 'wx'":
+                    parser.error("To use the GUI, the wxPython module must 
be installed.")
+
+                # Broken.
+                else:
+                    parser.error("The wxPython installation is broken:\n%s." 
% dep_check.wx_module_message)
 
             # Set the mode.
             self.mode = 'gui'




Related Messages


Powered by MHonArc, Updated Thu Apr 17 14:00:02 2014