polished string concatenations
This commit is contained in:
parent
cd0325baf1
commit
30024af6c2
|
@ -373,8 +373,8 @@ parser.set_defaults(linearreconstruction = False)
|
||||||
sep = {'n': '\n', 't': '\t', 's': ' '}
|
sep = {'n': '\n', 't': '\t', 's': ' '}
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
if options.scaling !=1.0 and options.linearreconstruction: print 'cannot scale for linear reconstruction'
|
if options.scaling != 1.0 and options.linearreconstruction: print 'cannot scale for linear reconstruction'
|
||||||
if options.scaling !=1.0 and options.filenodalcoords!='': print 'cannot scale when reading coordinate from file'
|
if options.scaling != 1.0 and options.filenodalcoords != '': print 'cannot scale when reading coordinate from file'
|
||||||
options.separator = options.separator.lower()
|
options.separator = options.separator.lower()
|
||||||
for filename in args:
|
for filename in args:
|
||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
|
@ -407,7 +407,7 @@ for filename in args:
|
||||||
for label in [options.defgrad] + options.tensor:
|
for label in [options.defgrad] + options.tensor:
|
||||||
column['tensor'][label] = -1
|
column['tensor'][label] = -1
|
||||||
for col,head in enumerate(headings):
|
for col,head in enumerate(headings):
|
||||||
if head == label or head == '1_%s'%label:
|
if head == label or head == '1_'+label:
|
||||||
column['tensor'][label] = col
|
column['tensor'][label] = col
|
||||||
maxcol = max(maxcol,col+9)
|
maxcol = max(maxcol,col+9)
|
||||||
break
|
break
|
||||||
|
@ -420,17 +420,17 @@ for filename in args:
|
||||||
for label in options.vector:
|
for label in options.vector:
|
||||||
column['vector'][label] = -1
|
column['vector'][label] = -1
|
||||||
for col,head in enumerate(headings):
|
for col,head in enumerate(headings):
|
||||||
if head == label or head == '1_%s'%label:
|
if head == label or head == '1_'+label:
|
||||||
column['vector'][label] = col
|
column['vector'][label] = col
|
||||||
maxcol = max(maxcol,col+3)
|
maxcol = max(maxcol,col+3)
|
||||||
break
|
break
|
||||||
|
|
||||||
for length,what in enumerate(['scalar','double','triple','quadruple']):
|
for length,what in enumerate(['scalar','double','triple','quadruple']):
|
||||||
column[what] = {}
|
column[what] = {}
|
||||||
for label in eval('options.%s'%what):
|
for label in eval('options.'+what):
|
||||||
column[what][label] = -1
|
column[what][label] = -1
|
||||||
for col,head in enumerate(headings):
|
for col,head in enumerate(headings):
|
||||||
if head == label or head == '1_%s'%label:
|
if head == label or head == '1_'+label:
|
||||||
column[what][label] = col
|
column[what][label] = col
|
||||||
maxcol = max(maxcol,col+1+length)
|
maxcol = max(maxcol,col+1+length)
|
||||||
break
|
break
|
||||||
|
@ -526,7 +526,7 @@ for filename in args:
|
||||||
|
|
||||||
for datatype in fields.keys():
|
for datatype in fields.keys():
|
||||||
print '\n%s:'%datatype,
|
print '\n%s:'%datatype,
|
||||||
for what in eval('options.%s'%datatype):
|
for what in eval('options.'+datatype):
|
||||||
col = column[datatype][what]
|
col = column[datatype][what]
|
||||||
if col != -1:
|
if col != -1:
|
||||||
print what,
|
print what,
|
||||||
|
@ -541,7 +541,7 @@ for filename in args:
|
||||||
for what in out.keys():
|
for what in out.keys():
|
||||||
print what
|
print what
|
||||||
(head,tail) = os.path.split(filename)
|
(head,tail) = os.path.split(filename)
|
||||||
vtk = open(os.path.join(head,'%s_'%what+os.path.splitext(tail)[0]+'.vtk'), 'w')
|
vtk = open(os.path.join(head,what+'_'+os.path.splitext(tail)[0]+'.vtk'), 'w')
|
||||||
output(out[what],{'filepointer':vtk},'File')
|
output(out[what],{'filepointer':vtk},'File')
|
||||||
vtk.close()
|
vtk.close()
|
||||||
print
|
print
|
||||||
|
|
Loading…
Reference in New Issue