# initialization of class attributes
self.__dict__ = dict()
self.cfg = None # the config that will be read using pyconf module
+ self.arguments = opt
self.options = options # the options passed to salomeTools
self.dataDir = dataDir # default value will be <salomeTools root>/data
# set the commands by calling the dedicated function
res = __module__.run(argv, self, logger_command)
finally:
# put final attributes in xml log file (end time, total time, ...) and write it
- logger_command.endWrite()
+ launchedCommand = ' '.join([self.cfg.VARS.salometoolsway + os.path.sep + 'sat', self.arguments.split(' ')[0], args])
+ logger_command.endWrite({"launchedCommand" : launchedCommand})
return res
'''
sys.stdout.flush()
- def endWrite(self):
+ def endWrite(self, attribute):
'''Method called just after command end : Put all fields corresponding to the command end context (time).
Write the log xml file on the hard drive.
And display the command to launch to get the log
self.xmlFile.append_node_attrib("Site", attrib={"endTime" : endtime})
self.xmlFile.append_node_attrib("Site", attrib={"TotalTime" : "%ih%im%is" % (hours, minutes, seconds)})
+ # Add the attribute passed to the method
+ self.xmlFile.append_node_attrib("Site", attrib=attribute)
+
# Call the method to write the xml file on the hard drive
self.xmlFile.write_tree(stylesheet = "command.xsl")