From: SPN Salome - CEA Date: Mon, 4 Dec 2017 15:37:02 +0000 (+0100) Subject: Artifact 8916 : Replace shutils.copy2(...) by shutils.copy(...) for stylesheets X-Git-Tag: 5.0.0b3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=15c3757c1e8470d854482b98392520b547662c1c;p=tools%2Fsat.git Artifact 8916 : Replace shutils.copy2(...) by shutils.copy(...) for stylesheets --- diff --git a/commands/jobs.py b/commands/jobs.py index 15d33f8..3d6540e 100644 --- a/commands/jobs.py +++ b/commands/jobs.py @@ -1797,7 +1797,9 @@ def run(args, runner, logger): files_to_copy.append(os.path.join(xsl_dir, "command.xsl")) files_to_copy.append(os.path.join(xsl_dir, "running.gif")) for file_path in files_to_copy: - shutil.copy2(file_path, log_dir) + # OP We use copy instead of copy2 to update the creation date + # So we can clean the LOGS directories easily + shutil.copy(file_path, log_dir) # Instanciate the Gui in order to produce the xml files that contain all # the boards diff --git a/commands/log.py b/commands/log.py index 08e5f23..01164bf 100644 --- a/commands/log.py +++ b/commands/log.py @@ -257,11 +257,13 @@ def run(args, runner, logger): imgLogo = os.path.join(xslDir, "LOGO-SAT.png") # copy the stylesheets in the log directory - shutil.copy2(xslCommand, logDir) - shutil.copy2(xslHat, logDir) + # OP We use copy instead of copy2 to update the creation date + # So we can clean the LOGS directories easily + shutil.copy(xslCommand, logDir) + shutil.copy(xslHat, logDir) src.ensure_path_exists(os.path.join(logDir, "TEST")) - shutil.copy2(xsltest, os.path.join(logDir, "TEST")) - shutil.copy2(imgLogo, logDir) + shutil.copy(xsltest, os.path.join(logDir, "TEST")) + shutil.copy(imgLogo, logDir) # If the last option is invoked, just, show the last log file if options.last_terminal: @@ -332,4 +334,4 @@ def run(args, runner, logger): if not options.no_browser: logger.write(_("\nOpening the log file\n"), 3) src.system.show_in_editor(runner.cfg.USER.browser, xmlHatFilePath, logger) - return 0 \ No newline at end of file + return 0