Author: bugman Date: Wed Nov 14 10:20:30 2012 New Revision: 17960 URL: http://svn.gna.org/viewcvs/relax?rev=17960&view=rev Log: The pipe.display user function now uses relax_io.write_data() for better output formatting. Modified: trunk/generic_fns/pipes.py Modified: trunk/generic_fns/pipes.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/pipes.py?rev=17960&r1=17959&r2=17960&view=diff ============================================================================== --- trunk/generic_fns/pipes.py (original) +++ trunk/generic_fns/pipes.py Wed Nov 14 10:20:30 2012 @@ -34,6 +34,7 @@ from data import Relax_data_store; ds = Relax_data_store() from dep_check import C_module_exp_fn, scipy_module from relax_errors import RelaxError, RelaxNoPipeError, RelaxPipeError +from relax_io import write_data from status import Status; status = Status() @@ -256,22 +257,23 @@ # Acquire the pipe lock, and make sure it is finally released. status.pipe_lock.acquire(sys._getframe().f_code.co_name) try: - # Heading. - print("%-20s%-20s%-20s%-20s" % ("Data pipe name", "Data pipe type", "Bundle", "Current")) - # Loop over the data pipes. + data = [] for pipe_name in ds: # The current data pipe. current = '' if pipe_name == cdp_name(): current = '*' - # Print out. - print("%-20s%-20s%-20s%-20s" % (repr(pipe_name), get_type(pipe_name), repr(get_bundle(pipe_name)), current)) + # Store the data for the print out. + data.append([repr(pipe_name), get_type(pipe_name), repr(get_bundle(pipe_name)), current]) # Release the lock. finally: status.pipe_lock.release(sys._getframe().f_code.co_name) + + # Print out. + write_data(out=sys.stdout, headings=["Data pipe name", "Data pipe type", "Bundle", "Current"], data=data) def get_bundle(pipe=None):