updated to new ASCII table style
This commit is contained in:
parent
9ee49b2c3b
commit
1149053c61
|
@ -48,13 +48,14 @@ for i in xrange(len(options.formulas)):
|
|||
|
||||
# --- loop over input files -------------------------------------------------------------------------
|
||||
|
||||
if filenames == []: filenames = ['STDIN']
|
||||
if filenames == []: filenames = [None]
|
||||
|
||||
for name in filenames:
|
||||
if not (name == 'STDIN' or os.path.exists(name)): continue
|
||||
table = damask.ASCIItable(name = name, outname = name+'_tmp',
|
||||
buffered = False)
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name != 'STDIN' else ''))
|
||||
try:
|
||||
table = damask.ASCIItable(name = name, buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
|
||||
# ------------------------------------------ read header -------------------------------------------
|
||||
|
||||
|
@ -119,10 +120,9 @@ for name in filenames:
|
|||
|
||||
for label in [x for x in options.labels if x not in set(brokenFormula)]:
|
||||
table.data_append(unravel(eval(evaluator[label])))
|
||||
# table.data_append(unravel(eval(eval(evaluator[label]))))
|
||||
|
||||
outputAlive = table.data_write() # output processed line
|
||||
|
||||
# ------------------------------------------ output finalization -----------------------------------
|
||||
|
||||
table.close() # close ASCII tables
|
||||
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new
|
||||
|
|
|
@ -35,13 +35,14 @@ parser.set_defaults(defgrad = 'f',
|
|||
|
||||
# --- loop over input files -------------------------------------------------------------------------
|
||||
|
||||
if filenames == []: filenames = ['STDIN']
|
||||
if filenames == []: filenames = [None]
|
||||
|
||||
for name in filenames:
|
||||
if not (name == 'STDIN' or os.path.exists(name)): continue
|
||||
table = damask.ASCIItable(name = name, outname = name+'_tmp',
|
||||
buffered = False)
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name != 'STDIN' else ''))
|
||||
try:
|
||||
table = damask.ASCIItable(name = name, buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
@ -81,4 +82,3 @@ for name in filenames:
|
|||
# ------------------------------------------ output finalization -----------------------------------
|
||||
|
||||
table.close() # close input ASCII table (works for stdin)
|
||||
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new
|
||||
|
|
Loading…
Reference in New Issue