mailr7058 - in /1.3: dep_check.py generic_fns/vmd.py


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

Header


Content

Posted by edward on August 01, 2008 - 12:09:
Author: bugman
Date: Fri Aug  1 11:14:01 2008
New Revision: 7058

URL: http://svn.gna.org/viewcvs/relax?rev=7058&view=rev
Log:
Shifted the VMD module import check into dep_check.py.


Modified:
    1.3/dep_check.py
    1.3/generic_fns/vmd.py

Modified: 1.3/dep_check.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/dep_check.py?rev=7058&r1=7057&r2=7058&view=diff
==============================================================================
--- 1.3/dep_check.py (original)
+++ 1.3/dep_check.py Fri Aug  1 11:14:01 2008
@@ -106,6 +106,14 @@
 except ImportError:
     scientific_pdb_module = False
 
+# VMD module imports.
+try:
+    from Scientific.Visualization import VMD    # This requires Numeric to 
be installed (at least in Scientific 2.7.8).
+    del VMD
+    vmd_module = True
+except ImportError:
+    vmd_module = False
+
 
 # Compiled C modules.
 #####################

Modified: 1.3/generic_fns/vmd.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/vmd.py?rev=7058&r1=7057&r2=7058&view=diff
==============================================================================
--- 1.3/generic_fns/vmd.py (original)
+++ 1.3/generic_fns/vmd.py Fri Aug  1 11:14:01 2008
@@ -23,15 +23,9 @@
 # Module docstring.
 """Module for interfacing with VMD."""
 
-# Python module imports.
-module_avail = False
-try:
-    from Scientific.Visualization import VMD    # This requires Numeric to 
be installed (at least in Scientific 2.7.8).
-except ImportError:
-    module_avail = False
-
 # relax module imports.
 from data import Relax_data_store; ds = Relax_data_store()
+import dep_check
 from relax_errors import RelaxNoPdbError
 
 
@@ -39,9 +33,8 @@
     """Function for viewing the collection of molecules using VMD."""
 
     # Test if the module is available.
-    if not module_avail:
-        print "VMD is not available (cannot import 
Scientific.Visualization.VMD due to missing Numeric dependency)."
-        return
+    if not dep_check.vmd_module:
+        raise RelaxError, "VMD is not available (cannot import 
Scientific.Visualization.VMD due to missing Numeric dependency)."
 
     # Alias the current data pipe.
     cdp = ds[ds.current_pipe]




Related Messages


Powered by MHonArc, Updated Fri Aug 01 13:00:12 2008