Skip to content
Snippets Groups Projects
Commit 02acdd5c authored by Marko Mecina's avatar Marko Mecina
Browse files

fix formatting in csv generator

parent ed8439dc
No related branches found
No related tags found
No related merge requests found
......@@ -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() + '/'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment