From 02acdd5c88f43211254556b8426bbcd3fbd67f9d Mon Sep 17 00:00:00 2001 From: Marko Mecina <marko.mecina@univie.ac.at> Date: Tue, 28 Jan 2025 14:40:24 +0100 Subject: [PATCH] fix formatting in csv generator --- Tst/json_to_csv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tst/json_to_csv.py b/Tst/json_to_csv.py index 366d6d6..36eb064 100755 --- a/Tst/json_to_csv.py +++ b/Tst/json_to_csv.py @@ -34,14 +34,14 @@ def run(jfile, outfile): steps.append(comment) if outfile[-1] == '/': # If only path is given but no filename - outfile = outfile + data['_name'] + '-' + '-'.join(data['_spec_version'].split('-')[-2:]) + '.csv_PIPE' + outfile = outfile + data['_name'] + '-TS-' + '-'.join(data['_spec_version'].split('-')[-2:]) + '.csv_PIPE' with open(outfile, 'w') as fd: if len(data['_comment']) != 0: buf = '\n'.join([header, name, date, testcomment, precond] + steps + [postcond]) else: buf = '\n'.join([header, name, date, precond] + steps + [postcond]) - buf = buf.replace('_', '\\_') + buf = buf.replace('_', '\\_').replace('&', '\\&') fd.write(buf) @@ -52,7 +52,7 @@ def replace_newline(txt): if __name__ == '__main__': json_file_path = sys.argv[1] - if len(sys.argv) > 1: # If filename is given + if len(sys.argv) > 2: # If filename is given outputfile = sys.argv[2] else: # If no filename is given take the working directory path, filename is used from the json file outputfile = os.getcwd() + '/' -- GitLab