mailr16646 - /branches/uf_redesign/generic_fns/pipes.py


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

Header


Content

Posted by edward on June 04, 2012 - 19:37:
Author: bugman
Date: Mon Jun  4 19:37:00 2012
New Revision: 16646

URL: http://svn.gna.org/viewcvs/relax?rev=16646&view=rev
Log:
The generic_fns.pipes.pipe_names() function now can restrict the list of 
names to a specific bundle.


Modified:
    branches/uf_redesign/generic_fns/pipes.py

Modified: branches/uf_redesign/generic_fns/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/generic_fns/pipes.py?rev=16646&r1=16645&r2=16646&view=diff
==============================================================================
--- branches/uf_redesign/generic_fns/pipes.py (original)
+++ branches/uf_redesign/generic_fns/pipes.py Mon Jun  4 19:37:00 2012
@@ -382,14 +382,31 @@
         status.pipe_lock.release(sys._getframe().f_code.co_name)
 
 
-def pipe_names():
+def pipe_names(bundle=None):
     """Return the list of all data pipes.
 
-    @return:        The list of data pipes.
-    @rtype:         list of str
-    """
-
-    return list(ds.keys())
+    @keyword bundle:    If supplied, the pipe names will be restricted to 
those of the bundle.
+    @type bundle:       str or None
+    @return:            The list of data pipes.
+    @rtype:             list of str
+    """
+
+    # Initialise.
+    names = []
+    pipes = ds.keys()
+    pipes.sort()
+
+    # Loop over the pipes.
+    for pipe in pipes:
+        # The bundle restriction.
+        if bundle and get_bundle(pipe) != bundle:
+            continue
+
+        # Add the pipe.
+        names.append(pipe)
+
+    # Return the pipe list.
+    return names
 
 
 def switch(pipe_name=None):




Related Messages


Powered by MHonArc, Updated Mon Jun 04 19:40:02 2012