source: trunk/python/Rappture/result.py @ 115

Last change on this file since 115 was 115, checked in by mmc, 19 years ago

Updated all copyright notices.

File size: 1017 bytes
Line 
1# ----------------------------------------------------------------------
2#  COMPONENT: result - provides a simple way to report results
3#
4#  This routine encapsulates the action of reporting results
5#  back to Rappture.
6# ======================================================================
7#  AUTHOR:  Michael McLennan, Purdue University
8#  Copyright (c) 2004-2005  Purdue Research Foundation
9#
10#  See the file "license.terms" for information on usage and
11#  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12# ======================================================================
13import time
14
15def result(lib):
16    """
17    Use this function to report the result of a Rappture simulation.
18    Pass in the XML object representing the initial driver with
19    results substituted into it.
20    """
21
22    runfile = 'run%d.xml' % time.time()
23    fp = open(runfile,'w')
24    fp.write(lib.xml())
25    fp.close()
26
27    # pass the name of the run file back to Rappture
28    print '=RAPPTURE-RUN=>%s' % runfile
Note: See TracBrowser for help on using the repository browser.