mailr6434 - /1.3/generic_fns/results.py


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

Header


Content

Posted by edward on June 22, 2008 - 19:14:
Author: bugman
Date: Sun Jun 22 19:14:31 2008
New Revision: 6434

URL: http://svn.gna.org/viewcvs/relax?rev=6434&view=rev
Log:
Converted the display() function to the new relax design.


Modified:
    1.3/generic_fns/results.py

Modified: 1.3/generic_fns/results.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/results.py?rev=6434&r1=6433&r2=6434&view=diff
==============================================================================
--- 1.3/generic_fns/results.py (original)
+++ 1.3/generic_fns/results.py Sun Jun 22 19:14:31 2008
@@ -51,30 +51,31 @@
     copy(run1=run1, run2=run2, sim=sim)
 
 
-def display(run=None, format='columnar'):
-    """Function for displaying the results."""
+def display(format='xml'):
+    """Displaying the results/contents of the current data pipe.
 
-    # Test if the run exists.
-    if not run in ds.run_names:
-        raise RelaxNoPipeError, run
+    @keyword format:    The format of the displayed results.
+    @type format:       str
+    """
 
-    # Function type.
-    function_type = ds.run_types[ds.run_names.index(run)]
+    # Test if the current data pipe exists.
+    if not ds.current_pipe:
+        raise RelaxNoPipeError
 
     # Specific results writing function.
     if format == 'xml':
-        self.write_function = ds.xml_write
+        write_function = ds.xml_write
     elif format == 'columnar':
-        self.write_function = 
self.relax.specific_setup.setup('write_columnar_results', function_type, 
raise_error=0)
+        write_function = get_specific_fn('write_columnar_results', 
ds[ds.current_pipe].pipe_type, raise_error=False)
     else:
         raise RelaxError, "Unknown format " + `format` + "."
 
     # No function.
-    if not self.write_function:
-        raise RelaxError, "The " + format + " format is not currently 
supported for " + self.relax.specific_setup.get_string(function_type) + "."
+    if not write_function:
+        raise RelaxError, "The " + format + " format is not currently 
supported for " + get_string(ds[ds.current_pipe].pipe_type) + "."
 
     # Write the results.
-    self.write_function(sys.stdout, run)
+    write_function(sys.stdout)
 
 
 def read(file='results', directory=None, file_data=None, format='columnar', 
verbosity=1):




Related Messages


Powered by MHonArc, Updated Sun Jun 22 19:20:16 2008