Skip to content
Snippets Groups Projects
Commit ca18c187 authored by Timo Koch's avatar Timo Koch
Browse files

[bin][extractlinedata] Small improvements

* Make make dir of output dir more consise and handle "  " case
* simplify verbose output
parent 9fe97d9e
No related branches found
No related tags found
1 merge request!2207Feature/improve extract line data
...@@ -24,8 +24,8 @@ except: ...@@ -24,8 +24,8 @@ except:
# import locations # import locations
outDirectory = args['outputDirectory'] outDirectory = args['outputDirectory']
if not outDirectory == '' and not os.path.exists(outDirectory): if outDirectory.strip():
os.makedirs(outDirectory) os.makedirs(outDirectory, exist_ok=True)
# loop over all vtk files # loop over all vtk files
counter = 0 counter = 0
...@@ -68,11 +68,8 @@ for curFile in args['files']: ...@@ -68,11 +68,8 @@ for curFile in args['files']:
# print the parameters and the column numbers # print the parameters and the column numbers
if args['verbosity'] == 2: if args['verbosity'] == 2:
with open(csvFileName) as f: with open(csvFileName) as csvFile:
print(csvFileName) print(csvFileName)
reader = csv.reader(f) paramList = list(csv.reader(csvFile))[0]
paramList = list(reader) for i, param in enumerate(paramList):
paramCounter=1 print("{:>5} {}".format(i+1, param))
for param in paramList[0]:
print("%-2i %s" % (paramCounter, param))
paramCounter += 1
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