Author: bugman Date: Sun Jun 8 01:42:45 2008 New Revision: 6331 URL: http://svn.gna.org/viewcvs/relax?rev=6331&view=rev Log: Improved the relaxation curve fitting C module check to differentiate between missing and bad modules. Modified: 1.3/dep_check.py Modified: 1.3/dep_check.py URL: http://svn.gna.org/viewcvs/relax/1.3/dep_check.py?rev=6331&r1=6330&r2=6331&view=diff ============================================================================== --- 1.3/dep_check.py (original) +++ 1.3/dep_check.py Sun Jun 8 01:42:45 2008 @@ -27,6 +27,8 @@ """ # Python modules. +import platform +from os import F_OK, access, sep import sys @@ -112,8 +114,22 @@ try: from maths_fns.relax_fit import setup del setup -except ImportError: - sys.stderr.write("\nImportError: relaxation curve fitting is unavailable, try compiling the C modules.\n") + C_module_exp_fn = True +except ImportError, message: + # The OS. + system = platform.system() + + # Does the compiled file exist. + file = 'relax_fit.so' + if system == 'Windows' or system == 'Microsoft': + file = 'relax_fit.pyd' + if not access('maths_fns' + sep + file, F_OK): + sys.stderr.write("\nImportError: relaxation curve fitting is unavailable, the corresponding C modules have not been compiled.\n") + + # Error print out. + else: + sys.stderr.write("\nImportError: " + message[0]) + sys.stderr.write("\nRelaxation curve fitting is unavailable, try compiling the C modules.") + + # Set the flag. C_module_exp_fn = False -else: - C_module_exp_fn = True