mailr11628 - /1.3/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 October 06, 2010 - 12:47:
Author: bugman
Date: Wed Oct  6 12:47:20 2010
New Revision: 11628

URL: http://svn.gna.org/viewcvs/relax?rev=11628&view=rev
Log:
pipe.delete() without args will now delete all data pipes.


Modified:
    1.3/generic_fns/pipes.py

Modified: 1.3/generic_fns/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pipes.py?rev=11628&r1=11627&r2=11628&view=diff
==============================================================================
--- 1.3/generic_fns/pipes.py (original)
+++ 1.3/generic_fns/pipes.py Wed Oct  6 12:47:20 2010
@@ -121,17 +121,27 @@
     @type pipe_name:    str
     """
 
-    # Test if the data pipe exists.
+    # Pipe name is supplied.
     if pipe_name != None:
+        # Test if the data pipe exists.
         test(pipe_name)
 
-    # Delete the data pipe.
-    del ds[pipe_name]
-
-    # Set the current data pipe to None if it is the deleted data pipe.
-    if ds.current_pipe == pipe_name:
-        ds.current_pipe = None
-        __builtin__.cdp = None
+        # Convert to a list.
+        pipes = [pipe_name]
+
+    # All pipes.
+    else:
+        pipes = ds.keys()
+
+    # Loop over the pipes.
+    for pipe in pipes:
+        # Delete the data pipe.
+        del ds[pipe]
+
+        # Set the current data pipe to None if it is the deleted data pipe.
+        if ds.current_pipe == pipe:
+            ds.current_pipe = None
+            __builtin__.cdp = None
 
 
 def display():




Related Messages


Powered by MHonArc, Updated Wed Oct 06 13:00:02 2010