Author: bugman Date: Sun Jun 8 01:10:32 2008 New Revision: 6330 URL: http://svn.gna.org/viewcvs/relax?rev=6330&view=rev Log: Shifted the import check of Scientific.IO.PDB into dep_check. Modified: 1.3/dep_check.py 1.3/generic_fns/structure/scientific.py Modified: 1.3/dep_check.py URL: http://svn.gna.org/viewcvs/relax/1.3/dep_check.py?rev=6330&r1=6329&r2=6330&view=diff ============================================================================== --- 1.3/dep_check.py (original) +++ 1.3/dep_check.py Sun Jun 8 01:10:32 2008 @@ -96,6 +96,14 @@ devnull_import = False devnull_import_message = message.args[0] +# Scientific Python import. +try: + from Scientific.IO import PDB + del PDB + scientific_pdb_module = True +except ImportError: + scientific_pdb_module = False + # Compiled C modules. ##################### Modified: 1.3/generic_fns/structure/scientific.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/scientific.py?rev=6330&r1=6329&r2=6330&view=diff ============================================================================== --- 1.3/generic_fns/structure/scientific.py (original) +++ 1.3/generic_fns/structure/scientific.py Sun Jun 8 01:10:32 2008 @@ -23,18 +23,15 @@ # Module docstring. """Module containing the Scientific Python PDB specific structural object class.""" +# Dependency check module. +import dep_check # Python module imports. from math import sqrt from numpy import array, dot, float64, zeros +if dep_check.scientific_pdb_module: + import Scientific.IO.PDB from warnings import warn - -# Scientific Python import. -module_avail = True -try: - import Scientific.IO.PDB -except ImportError: - module_avail = False # relax module imports. from api_base import Base_struct_API @@ -54,7 +51,7 @@ """Initialise the class.""" # Test for the PDB parser availability. - if not module_avail: + if not dep_check.scientific_pdb_module: raise RelaxError, "The Scientific python PDB module Scientific.IO.PDB could not be imported." # The parser specific data object.