Commit 165bde24 authored by Jose Enrique.Ruiz's avatar Jose Enrique.Ruiz
Browse files

add -q flag to reset session and remove log file

parent 429aa4ba
......@@ -501,6 +501,7 @@ def provprocessparsing():
parser = OptionParser(usage=message)
parser.add_option("-c", "--config", action="store", dest="configfile", default="cfg/sequencer.cfg",
help="use specific config file [default cfg/sequencer.cfg]")
parser.add_option("-q", action="store_true", dest="quit", help="use this flag to reset session and remove log file")
# Parse the command line
(opts, args) = parser.parse_args()
......@@ -512,6 +513,7 @@ def provprocessparsing():
options.run = args[0]
options.out = args[1]
options.configfile = opts.configfile
options.quit = opts.quit
return options, tag
......
......@@ -160,9 +160,8 @@ if __name__ == "__main__":
# 02006
# /fefs/aswg/data/real/DL1/20200218/v0.4.3_v00
# -c cfg/sequencer.cfg
# TODO: add type of prov processing to be done as arg - now only r0_to_dl1
# TODO: add flag to remove log file, normally after dl1_to_dl2
# -q
# TODO: add type of prov processing to be done as arg - now only r0_to_dl1 in parse_lines_dl1
options, tag = cliopts.provprocessparsing()
......@@ -206,9 +205,9 @@ if __name__ == "__main__":
shutil.move(session_logfilename, log_path)
# remove LOG_FILENAME
# TODO: only if flag remove is set
remove_log_file = Path(LOG_FILENAME)
remove_log_file.unlink()
if options.quit:
remove_log_file = Path(LOG_FILENAME)
remove_log_file.unlink()
# make json
try:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment