mailr7364 - in /1.3/generic_fns/structure: internal.py scientific.py


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

Header


Content

Posted by edward on September 26, 2008 - 18:37:
Author: bugman
Date: Fri Sep 26 18:37:42 2008
New Revision: 7364

URL: http://svn.gna.org/viewcvs/relax?rev=7364&view=rev
Log:
Added some checks for the PDB files.


Modified:
    1.3/generic_fns/structure/internal.py
    1.3/generic_fns/structure/scientific.py

Modified: 1.3/generic_fns/structure/internal.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/internal.py?rev=7364&r1=7363&r2=7364&view=diff
==============================================================================
--- 1.3/generic_fns/structure/internal.py (original)
+++ 1.3/generic_fns/structure/internal.py Fri Sep 26 18:37:42 2008
@@ -25,7 +25,7 @@
 
 # Python module imports.
 from numpy import array, float64, linalg, zeros
-from os import path
+from os import F_OK, access, path
 from re import search
 from string import split, strip, upper
 from warnings import warn
@@ -37,7 +37,7 @@
 from generic_fns.mol_res_spin import Selection
 from relax_errors import RelaxError
 from relax_io import open_read_file
-from relax_warnings import RelaxWarning
+from relax_warnings import RelaxWarning, RelaxNoPDBFileWarning
 
 
 
@@ -785,6 +785,11 @@
         if verbosity:
             print "Internal relax PDB parser.\n"
 
+        # Test if the file exists.
+        if not access(file_path, F_OK):
+            warn(RelaxNoPDBFileWarning(file_path))
+            return
+
         # Set the file name and path.
         expanded = path.split(file_path)
         self.path.append(expanded[0])

Modified: 1.3/generic_fns/structure/scientific.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/scientific.py?rev=7364&r1=7363&r2=7364&view=diff
==============================================================================
--- 1.3/generic_fns/structure/scientific.py (original)
+++ 1.3/generic_fns/structure/scientific.py Fri Sep 26 18:37:42 2008
@@ -29,7 +29,7 @@
 # Python module imports.
 from math import sqrt
 from numpy import array, dot, float64, zeros
-from os import path
+from os import F_OK, access, path
 if dep_check.scientific_pdb_module:
     import Scientific.IO.PDB
 from warnings import warn
@@ -40,7 +40,7 @@
 from generic_fns import relax_re
 from generic_fns.mol_res_spin import Selection, parse_token, tokenise
 from relax_errors import RelaxError, RelaxPdbLoadError
-from relax_warnings import RelaxWarning, RelaxNoAtomWarning, 
RelaxZeroVectorWarning
+from relax_warnings import RelaxWarning, RelaxNoAtomWarning, 
RelaxNoPDBFileWarning, RelaxZeroVectorWarning
 
 
 class Scientific_data(Base_struct_API):
@@ -478,6 +478,11 @@
         if verbosity:
             print "Scientific Python PDB parser.\n"
 
+        # Test if the file exists.
+        if not access(file_path, F_OK):
+            warn(RelaxNoPDBFileWarning(file_path))
+            return
+
         # Set the file name and path.
         expanded = path.split(file_path)
         self.path.append(expanded[0])




Related Messages


Powered by MHonArc, Updated Fri Sep 26 19:00:02 2008