mailr3167 - in /1.3: generic_fns/pipes.py prompt/pipe.py


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

Header


Content

Posted by edward on March 13, 2007 - 04:47:
Author: bugman
Date: Tue Mar 13 04:46:31 2007
New Revision: 3167

URL: http://svn.gna.org/viewcvs/relax?rev=3167&view=rev
Log:
Created the pipe.list() user function for printing a list of all the data 
pipes.

Modified:
    1.3/generic_fns/pipes.py
    1.3/prompt/pipe.py

Modified: 1.3/generic_fns/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pipes.py?rev=3167&r1=3166&r2=3167&view=diff
==============================================================================
--- 1.3/generic_fns/pipes.py (original)
+++ 1.3/generic_fns/pipes.py Tue Mar 13 04:46:31 2007
@@ -101,6 +101,17 @@
         relax_data_store.current_pipe = None
 
 
+def list():
+    """Print the details of all the data pipes."""
+
+    # Heading.
+    print "%-20s%-20s" % ("Data pipe name", "Data pipe type")
+
+    # Loop over the data pipes.
+    for pipe_name in relax_data_store:
+        print "%-20s%-20s" % (pipe_name, 
relax_data_store[pipe_name].pipe_type)
+
+
 def switch(pipe_name=None):
     """Switch the current data pipe to the given data pipe.
 

Modified: 1.3/prompt/pipe.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/pipe.py?rev=3167&r1=3166&r2=3167&view=diff
==============================================================================
--- 1.3/prompt/pipe.py (original)
+++ 1.3/prompt/pipe.py Tue Mar 13 04:46:31 2007
@@ -198,6 +198,26 @@
         self.__relax__.specific.hybrid.hybridise(hybrid=hybrid, pipes=pipes)
 
 
+    def list(self):
+        """Print a list of all the data pipes.
+
+        Examples
+        ~~~~~~~~
+
+        To run the user function, type:
+
+        relax> pipe.list()
+        """
+
+        # Function intro text.
+        if self.__relax__.interpreter.intro:
+            text = sys.ps3 + "pipe.list()"
+            print text
+
+        # Execute the functional code.
+        pipes.list()
+
+
     def switch(self, pipe_name=None):
         """Function for switching between data pipes.
 




Related Messages


Powered by MHonArc, Updated Tue Mar 13 05:00:08 2007