Author: bugman
Date: Sun Jan 11 17:27:34 2009
New Revision: 8386
URL: http://svn.gna.org/viewcvs/relax?rev=8386&view=rev
Log:
Fixes for the read() function.
Modified:
branches/bmrb/generic_fns/bmrb.py
Modified: branches/bmrb/generic_fns/bmrb.py
URL:
http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/bmrb.py?rev=8386&r1=8385&r2=8386&view=diff
==============================================================================
--- branches/bmrb/generic_fns/bmrb.py (original)
+++ branches/bmrb/generic_fns/bmrb.py Sun Jan 11 17:27:34 2009
@@ -28,7 +28,7 @@
# relax module imports.
from data import Relax_data_store; ds = Relax_data_store()
-from relax_errors import RelaxError, RelaxFileOverwriteError, RelaxNoPipeError
+from relax_errors import RelaxError, RelaxFileError, RelaxFileOverwriteError,
RelaxNoPipeError
from relax_io import get_file_path
from specific_fns.setup import get_specific_fn
@@ -58,17 +58,18 @@
if not ds[ds.current_pipe].is_empty():
raise RelaxError, "The current data pipe is not empty."
- # Get the full file path, for later use.
+ # Get the full file path.
file_path = get_file_path(file_name=file, dir=directory)
- # Open the file.
- file = open_read_file(file_name=file, dir=directory)
+ # Fail if the file does not exist.
+ if not access(file_path, F_OK):
+ raise RelaxFileError, file_path
# Specific results reading function.
read_function = get_specific_fn('bmrb_read', ds[ds.current_pipe].pipe_type)
# Read the results.
- read_function(file)
+ read_function(file_path)
def write(file=None, directory=None, force=False):
_______________________________________________
relax (http://nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits