mailr8818 - /branches/relax_disp/dep_check.py


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

Header


Content

Posted by sebastien . morin . 1 on February 17, 2009 - 19:14:
Author: semor
Date: Tue Feb 17 19:14:20 2009
New Revision: 8818

URL: http://svn.gna.org/viewcvs/relax?rev=8818&view=rev
Log:
Added dependency check for relaxation dispersion C modules.

This follows r8817.


Modified:
    branches/relax_disp/dep_check.py

Modified: branches/relax_disp/dep_check.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/dep_check.py?rev=8818&r1=8817&r2=8818&view=diff
==============================================================================
--- branches/relax_disp/dep_check.py (original)
+++ branches/relax_disp/dep_check.py Tue Feb 17 19:14:20 2009
@@ -140,3 +140,26 @@
 
     # Set the flag.
     C_module_exp_fn = False
+
+# Relaxation dispersion.
+try:
+    from maths_fns.relax_disp import setup
+    del setup
+    C_module_exp_fn = True
+except ImportError, message:
+    # The OS.
+    system = platform.system()
+
+    # Does the compiled file exist.
+    file = 'relax_disp.so'
+    if system == 'Windows' or system == 'Microsoft':
+        file = 'relax_disp.pyd'
+    if not access('maths_fns' + sep + file, F_OK):
+        C_module_exp_fn_mesg = "ImportError: relaxation dispersion is 
unavailable, the corresponding C modules have not been compiled."
+
+    # Show the full error.
+    else:
+        C_module_exp_fn_mesg = "ImportError: " + message[0] + "\nRelaxation 
dispersion is unavailable, try compiling the C modules."
+
+    # Set the flag.
+    C_module_exp_fn = False




Related Messages


Powered by MHonArc, Updated Tue Feb 17 20:20:04 2009