summaryrefslogtreecommitdiffstats
path: root/server/xmlrpc_API1.py
diff options
context:
space:
mode:
Diffstat (limited to 'server/xmlrpc_API1.py')
-rw-r--r--server/xmlrpc_API1.py10
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