Salome HOME
change some variable names for pep8
[tools/sat.git] / src / logger.py
index 61673bba53b929185699a2142b1c5f3285c095fe..d686489d5b0a9429a7d6e85ebfcae81c0824cbf3 100644 (file)
@@ -43,11 +43,11 @@ class Logger(object):
         
         # Construct xml log file location for sat prints.
         logFileName = config.VARS.datehour + "_" + config.VARS.command + ".xml"
-        logFilePath = os.path.join(config.SITE.log.logDir, logFileName)
+        logFilePath = os.path.join(config.SITE.log.log_dir, logFileName)
         # Construct txt file location in order to log 
         # the external commands calls (cmake, make, git clone, etc...)
         txtFileName = config.VARS.datehour + "_" + config.VARS.command + ".txt"
-        txtFilePath = os.path.join(config.SITE.log.logDir, "OUT", txtFileName)
+        txtFilePath = os.path.join(config.SITE.log.log_dir, "OUT", txtFileName)
         
         src.ensure_path_exists(os.path.dirname(logFilePath))
         src.ensure_path_exists(os.path.dirname(txtFilePath))
@@ -177,6 +177,17 @@ class Logger(object):
         # Call the method to write the xml file on the hard drive
         self.xmlFile.write_tree(stylesheet = "command.xsl")
         
+        # Dump the config in a pyconf file in the log directory
+        logDir = self.config.SITE.log.log_dir
+        dumpedPyconfFileName = (self.config.VARS.datehour 
+                                + "_" 
+                                + self.config.VARS.command 
+                                + ".pyconf")
+        dumpedPyconfFilePath = os.path.join(logDir, 'OUT', dumpedPyconfFileName)
+        f = open(dumpedPyconfFilePath, 'w')
+        self.config.__save__(f)
+        f.close()
+        
 
 def date_to_datetime(date):
     '''Little method that gets year, mon, day, hour ,