mailr26934 - /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 - 18:38:
Author: tlinnet
Date: Wed Dec  3 18:38:27 2014
New Revision: 26934

URL: http://svn.gna.org/viewcvs/relax?rev=26934&view=rev
Log:
Added in pipe_control.io to store io_ids in a list in cdp.

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=26934&r1=26933&r2=26934&view=diff
==============================================================================
--- branches/nmrglue/pipe_control/io.py (original)
+++ branches/nmrglue/pipe_control/io.py Wed Dec  3 18:38:27 2014
@@ -48,6 +48,25 @@
     obj_dict[io_id] = io_data
 
 
+def add_io_id(io_id=None):
+    """Add the io ID to the data store.
+
+    @keyword io_id:   The io ID string.
+    @type io_id:      str
+    """
+
+    # Initialise the structure, if needed.
+    if not hasattr(cdp, 'io_ids'):
+        cdp.io_ids = []
+
+    # The ID already exists.
+    if io_id in cdp.io_ids:
+        return
+
+    # Add the ID.
+    cdp.io_ids.append(io_id)
+
+
 def file_list(glob=None, dir=None, id=None):
     """Store in cdp.io_basename and cdp.io_file_root, a list of file 
basenames and a list of fileroot matching the pathname pattern.  It is stored 
in a dictionary with key 'id'.
     If 'id' is set to None, it is stored with the key set to the glob 
pattern.
@@ -67,6 +86,9 @@
     if id == None:
         id = glob
 
+    # Add the io_id to the data store.
+    add_io_id(io_id=id)
+
     # Store in cdp.
     add_io_data(object_name='io_basename', io_id=id, io_data=basename_list)
     add_io_data(object_name='io_file_root', io_id=id, io_data=file_root_list)




Related Messages


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