mailr25686 - /trunk/pipe_control/pipes.py


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

Header


Content

Posted by tlinnet on September 08, 2014 - 18:49:
Author: tlinnet
Date: Mon Sep  8 18:49:41 2014
New Revision: 25686

URL: http://svn.gna.org/viewcvs/relax?rev=25686&view=rev
Log:
To the back-end of display pipes, added functionality to sort the pipe names 
before printing.

Also added the return of the list of pipes, with its associated information 
about pipe type, and pipe_bundle.

This is to help with getting a better overview for multiple pipes in data 
store.

task #7826(https://gna.org/task/index.php?7826): Write an python class for 
the repeated analysis of dispersion data.

Modified:
    trunk/pipe_control/pipes.py

Modified: trunk/pipe_control/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/pipes.py?rev=25686&r1=25685&r2=25686&view=diff
==============================================================================
--- trunk/pipe_control/pipes.py (original)
+++ trunk/pipe_control/pipes.py Mon Sep  8 18:49:41 2014
@@ -30,7 +30,7 @@
 from dep_check import C_module_exp_fn, scipy_module
 from lib.compat import builtins
 from lib.errors import RelaxError, RelaxNoPipeError, RelaxPipeError
-from lib.io import write_data
+from lib.io import sort_filenames, write_data
 from status import Status; status = Status()
 
 
@@ -283,15 +283,22 @@
     status.observers.pipe_alteration.notify()
 
 
-def display():
+def display(sort=False, rev=False):
     """Print the details of all the data pipes."""
 
     # Acquire the pipe lock, and make sure it is finally released.
     status.pipe_lock.acquire(sys._getframe().f_code.co_name)
     try:
         # Loop over the data pipes.
+        pipe_names = []
+        for pipe_name_i in ds:
+            pipe_names.append(pipe_name_i)
+
+        if sort:
+            pipe_names = sort_filenames(filenames=pipe_names, rev=rev)
+
         data = []
-        for pipe_name in ds:
+        for pipe_name in pipe_names:
             # The current data pipe.
             current = ''
             if pipe_name == cdp_name():
@@ -306,6 +313,9 @@
 
     # Print out.
     write_data(out=sys.stdout, headings=["Data pipe name", "Data pipe type", 
"Bundle", "Current"], data=data)
+
+    # Return data
+    return data
 
 
 def get_bundle(pipe=None):




Related Messages


Powered by MHonArc, Updated Mon Sep 08 19:00:02 2014