diff options
author | David Sommerseth <davids@redhat.com> | 2009-08-05 19:23:08 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-08-05 19:23:08 +0200 |
commit | 3b21ff811a792becdbc59ad7800940df3befe09f (patch) | |
tree | 78faa852933e6c5b8a860f8e509f5e3387254213 /server/xmlrpc_API1.py | |
parent | 420b54a05a472518ab0e148e20cd365699620358 (diff) | |
download | rteval-3b21ff811a792becdbc59ad7800940df3befe09f.tar.gz rteval-3b21ff811a792becdbc59ad7800940df3befe09f.tar.xz rteval-3b21ff811a792becdbc59ad7800940df3befe09f.zip |
Improved possibility to get more debug info, and to run tests without executing SQL queries
Diffstat (limited to 'server/xmlrpc_API1.py')
-rw-r--r-- | server/xmlrpc_API1.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/xmlrpc_API1.py b/server/xmlrpc_API1.py index 25302d9..6faa02f 100644 --- a/server/xmlrpc_API1.py +++ b/server/xmlrpc_API1.py @@ -34,10 +34,11 @@ import rtevaldb class XMLRPC_API1(): - def __init__(self, dataroot="/tmp/rteval", nodbaction=False): + def __init__(self, dataroot="/tmp/rteval", debug=False, nodbaction=False): # Some defaults self.dataroot = dataroot self.fnametrans = string.maketrans("/\\", "::") # replace path delimiters in filenames + self.debug = debug self.nodbaction = nodbaction def __mkdatadir(self, dirpath): @@ -89,12 +90,15 @@ class XMLRPC_API1(): self.__mkdatadir(self.dataroot + '/reports/' + clientid) fname = self.__getfilename('reports/' + clientid,'report.xml', False) xmldoc.saveFormatFileEnc(fname,'UTF-8',1) + if self.debug: + print "Copy of report: %s" % fname # Register the report into a database and return the rteval run id + (syskey, rterid) = rtevaldb.register_report('xmlparser.xsl', xmldoc, fname, + debug=self.debug, noaction=self.nodbaction) if not self.nodbaction: - (syskey, rterid) = rtevaldb.register_report('xmlparser.xsl', xmldoc, fname) - else: rterid = 999999999 # Fake ID when no database registration is done + return rterid |