Commit 6f46f890 authored by Jose Enrique.Ruiz's avatar Jose Enrique.Ruiz
Browse files

make provenance file parameter optional

parent 16c031f0
......@@ -491,19 +491,21 @@ def rawcopycliparsing(command):
##############################################################################
def provprocessparsing():
tag = standardhandle.gettag()
message = "usage: %prog <RUN_NUMBER> <SOURCE_FILE> <DESTINATION_FOLDER>"
message = "usage: %prog [-p PROVFILE] <RUN_NUMBER> <DESTINATION_FOLDER>"
parser = OptionParser(usage=message)
parser.add_option("-p", "--prov", action="store", dest="provfile", default="prov.log",
help="provenance file to process [default prov.log]")
# Parse the command line
(opts, args) = parser.parse_args()
# Checking arguments
if len(args) != 3:
if len(args) != 2:
standardhandle.error(tag, "incorrect number of arguments, type -h for help", 2)
# Set global variables
options.run = args[0]
options.src = args[1]
options.out = args[2]
options.out = args[1]
options.src = opts.provfile
return options
......
......@@ -49,6 +49,10 @@ if __name__ == "__main__":
from osa.utils import cliopts
options = cliopts.provprocessparsing()
# check options.src is a file
#
#
# check options.out is a valid folder
# make folder log/ if does not exist
# add log/ to options.out = /fefs/aswg/data/real/DL1/20200218/v0.4.3_v00
......@@ -56,6 +60,7 @@ if __name__ == "__main__":
#
options.out = Path(options.out)
# process prov file
processed_lines = parse_lines_dl1(read_prov(logname=options.src), options.out)
#
#
......@@ -63,7 +68,6 @@ if __name__ == "__main__":
# build base_filename with options.run and options.out
#
#
base_filename = ""
json_filepath = options.out / f"{base_filename}.json"
png_filepath = options.out / f"{base_filename}.png"
......
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