X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/895710d49f77179d9893bc76b3e31b69fae638af..a672ac45418dce46fd0abe3ad97f129568ef383f:/tools/simgrid_convert_TI_traces.py diff --git a/tools/simgrid_convert_TI_traces.py b/tools/simgrid_convert_TI_traces.py index b4b3f2877c..f1a5ed7bd3 100755 --- a/tools/simgrid_convert_TI_traces.py +++ b/tools/simgrid_convert_TI_traces.py @@ -74,7 +74,7 @@ def convert_trace(trace_path, base_path, output_path, trace_version="1.0"): # " processed\n:OLD: " + line + "\n:NEW: " + new_line) new_trace.write(new_line + "\n") else: - new_trace.write(line) + new_trace.write(line.lower()) if __name__ == "__main__": @@ -99,7 +99,13 @@ if __name__ == "__main__": parents=True, exist_ok=True) # copy trace list file - shutil.copy(trace_list_file_path, args.output_path) + try: + shutil.copy(trace_list_file_path, args.output_path) + except shutil.SameFileError: + print("ERROR: Inplace replacement of the trace is not supported: " + "Please, select another output path") + sys.exit(-1) + with open(trace_list_file_path) as tracelist_file: trace_list = tracelist_file.readlines() @@ -111,6 +117,8 @@ if __name__ == "__main__": # process trace files for trace_path in trace_list: + if os.path.isabs(trace_path): + sys.exit("ERROR: Absolute path in the trace list file is not supported") convert_trace(trace_path, base_path, args.output_path) print("Traces converted!")