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

Last change on this file since 829 was 787, checked in by dkearney, 17 years ago

adding new !Library.cc which replaces library.py and result.py as python bindings to the c++ core rappture library module. The module is named !Rappture.Library.

File size: 1.0 KB
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    lib.put("tool.version.rappture.language", "python");
23    runfile = 'run%d.xml' % time.time()
24    fp = open(runfile,'w')
25    fp.write(lib.xml())
26    fp.close()
27
28    # pass the name of the run file back to Rappture
29    print '=RAPPTURE-RUN=>%s' % runfile
Note: See TracBrowser for help on using the repository browser.