]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
add the launched command to the log
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Mon, 15 Feb 2016 13:57:04 +0000 (14:57 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Mon, 15 Feb 2016 13:57:04 +0000 (14:57 +0100)
salomeTools.py
src/logger.py

index 32259207fc7cd0862b30b1cebf05570dbdbc7572..5e697edc89c4ac5fd14d45232991b363524070ba 100755 (executable)
@@ -88,6 +88,7 @@ class Sat(object):
         # 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
@@ -157,7 +158,8 @@ class Sat(object):
                     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
 
index 6568e57d37e8713586850ba8360c8f599477bc0d..2fa3c43a800a600985fdceb6708cce0e99296e7b 100644 (file)
@@ -115,7 +115,7 @@ class Logger(object):
         '''
         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
@@ -142,6 +142,9 @@ class Logger(object):
         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")