From 3b21ff811a792becdbc59ad7800940df3befe09f Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 5 Aug 2009 19:23:08 +0200 Subject: Improved possibility to get more debug info, and to run tests without executing SQL queries --- server/xmlrpc_API1.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'server/xmlrpc_API1.py') 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 -- cgit