shutil.copy2(xslHat, logDir)
shutil.copy2(imgLogo, logDir)
- xmlHatFilePath = os.path.join(logDir, 'hat.xml')
- src.xmlManager.update_hat_xml(logDir)
+ xmlHatFilePath = os.path.join(logDir, 'hat.xml')
+ if 'APPLICATION' in runner.cfg:
+ src.xmlManager.update_hat_xml(runner.cfg.VARS.logDir, runner.cfg.VARS.application)
+ else:
+ src.xmlManager.update_hat_xml(runner.cfg.VARS.logDir)
src.system.show_in_editor(runner.cfg.USER.browser, xmlHatFilePath)
\ No newline at end of file
self.xmlFile.add_simple_node("field", text=endtime , attrib={"name" : "endTime"})
self.xmlFile.add_simple_node("field", text="%ih%im%is" % (hours, minutes, seconds) , attrib={"name" : "Total Time"})
self.xmlFile.write_tree(stylesheet = "command.xsl")
- src.xmlManager.update_hat_xml(self.config.VARS.logDir)
+ if 'APPLICATION' in self.config:
+ src.xmlManager.update_hat_xml(self.config.VARS.logDir, self.config.VARS.application)
+ else:
+ src.xmlManager.update_hat_xml(self.config.VARS.logDir)
def date_to_datetime(date):
Y = int(date[:4])
if field.tag == node_name:
field.text += text
-def update_hat_xml(logDir):
+def update_hat_xml(logDir, application=None):
xmlHatFilePath = os.path.join(logDir, 'hat.xml')
- xmlHat = xmlLogFile(xmlHatFilePath, "LOGlist")
+ if application:
+ xmlHat = xmlLogFile(xmlHatFilePath, "LOGlist", {"application" : application})
+ else:
+ xmlHat = xmlLogFile(xmlHatFilePath, "LOGlist", {"application" : "NO"})
for fileName in os.listdir(logDir):
sExpr = "^[0-9]{8}_+[0-9]{6}_+[A-Za-z0-9]*.xml$"
</head>
<body class="def" bgcolor="aliceblue">
<h1><img src="LOGO-SAT.png"/></h1>
+ <xsl:choose>
+ <xsl:when test="LOGlist/@application='NO'">
+ <h1>Logs of commands without application</h1>
+ </xsl:when>
+ <xsl:otherwise>
+ <h1>
+ Logs of application <xsl:value-of select="LOGlist/@application"/>
+ </h1>
+ </xsl:otherwise>
+ </xsl:choose>
<table border="0">
<tr>
<td width="100px">Command</td><td width="100px">date</td><td>time</td>