mailr7444 - /branches/pipe_refs/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 September 29, 2008 - 23:20:
Author: bugman
Date: Mon Sep 29 23:20:20 2008
New Revision: 7444

URL: http://svn.gna.org/viewcvs/relax?rev=7444&view=rev
Log:
Renamed cdp() to get_pipe() and allowed it to return any desired data pipe.


Modified:
    branches/pipe_refs/generic_fns/pipes.py

Modified: branches/pipe_refs/generic_fns/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/pipe_refs/generic_fns/pipes.py?rev=7444&r1=7443&r2=7444&view=diff
==============================================================================
--- branches/pipe_refs/generic_fns/pipes.py (original)
+++ branches/pipe_refs/generic_fns/pipes.py Mon Sep 29 23:20:20 2008
@@ -94,16 +94,6 @@
     ds.add(pipe_name=pipe_name, pipe_type=pipe_type)
 
 
-def cdp():
-    """Return the current data pipe.
-    
-    @return:        The current data pipe.
-    @rtype:         PipeContainer instance
-    """
-
-    return ds[ds.current_pipe]
-
-
 def cdp_name():
     """Return the name of the current data pipe.
     
@@ -131,6 +121,23 @@
     # Set the current data pipe to None if it is the deleted data pipe.
     if ds.current_pipe == pipe_name:
         ds.current_pipe = None
+
+
+def get_pipe(name=None):
+    """Return a data pipe.
+
+    @keyword name:  The name of the data pipe to return.  If None, the 
current data pipe is
+                    returned.
+    @type name:     str or None
+    @return:        The current data pipe.
+    @rtype:         PipeContainer instance
+    """
+
+    # The name of the data pipe.
+    if name == None:
+        name = ds.current_pipe
+
+    return ds[name]
 
 
 def list():




Related Messages


Powered by MHonArc, Updated Mon Sep 29 23:40:02 2008