mailr26943 - /branches/nmrglue/pipe_control/io.py


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

Header


Content

Posted by tlinnet on December 03, 2014 - 20:40:
Author: tlinnet
Date: Wed Dec  3 20:40:57 2014
New Revision: 26943

URL: http://svn.gna.org/viewcvs/relax?rev=26943&view=rev
Log:
Expanding the pipe_control.io.file_list() function to print out info.

Task #7873 (https://gna.org/task/index.php?7873): Write wrapper function to 
nmrglue, to read .ft2 files and process them.
Homepage: http://www.nmrglue.com/
Link to nmrglue discussion: 
https://groups.google.com/forum/#!forum/nmrglue-discuss
The code is develop at Github: https://github.com/jjhelmus/nmrglue/
Documentation: http://nmrglue.readthedocs.org/en/latest/index.html

Modified:
    branches/nmrglue/pipe_control/io.py

Modified: branches/nmrglue/pipe_control/io.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/nmrglue/pipe_control/io.py?rev=26943&r1=26942&r2=26943&view=diff
==============================================================================
--- branches/nmrglue/pipe_control/io.py (original)
+++ branches/nmrglue/pipe_control/io.py Wed Dec  3 20:40:57 2014
@@ -22,9 +22,13 @@
 # Module docstring.
 """Module for the using of pipe_control.io."""
 
+# Python module imports.
+import sys
+
 # relax module imports.
 from lib.errors import RelaxError
 from lib.io import get_file_list
+from lib.text.sectioning import section
 from pipe_control.pipes import check_pipe
 
 
@@ -79,6 +83,9 @@
     @type id:               None or str
     """
 
+    # Data checks.
+    check_pipe()
+
     # Get the file list.
     basename_list, file_root_list = get_file_list(glob_pattern=glob, dir=dir)
 
@@ -88,8 +95,18 @@
 
     # Add the io_id to the data store.
     add_io_id(io_id=id)
+    # Printout.
+    section(file=sys.stdout, text="File list for ID='%s'"%(id), prespace=2)
 
-    # Store in cdp.
+    # Store in cdp and print info.
+    add_io_data(object_name='io_glob', io_id=id, io_data=glob)
+    print('cdp.io_glob["%s"] = "%s"'%(id, cdp.io_glob[id]))
+
     add_io_data(object_name='io_basename', io_id=id, io_data=basename_list)
+    print('cdp.io_basename["%s"] = %s'%(id, cdp.io_basename[id]))
+
     add_io_data(object_name='io_file_root', io_id=id, io_data=file_root_list)
+    print('cdp.io_file_root["%s"] = %s'%(id, cdp.io_file_root[id]))
+
     add_io_data(object_name='io_dir', io_id=id, io_data=dir)
+    print('cdp.io_dir["%s"] = "%s"'%(id, cdp.io_dir[id]))




Related Messages


Powered by MHonArc, Updated Wed Dec 03 21:00:02 2014