did not run

This commit is contained in:
Martin Diehl 2015-08-18 17:24:15 +00:00
parent 3835351ccc
commit 2a13d78196
3 changed files with 19 additions and 19 deletions

View File

@ -45,13 +45,14 @@ if options.tensor == None:
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------
if filenames == []: filenames = ['STDIN'] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
if not (name == 'STDIN' or os.path.exists(name)): continue try:
table = damask.ASCIItable(name = name, outname = name+'_tmp', table = damask.ASCIItable(name = name, buffered = False)
buffered = False) except:
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name != 'STDIN' else '')) continue
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------
@ -102,4 +103,3 @@ for name in filenames:
# ------------------------------------------ output finalization ----------------------------------- # ------------------------------------------ output finalization -----------------------------------
table.close() # close input ASCII table (works for stdin) table.close() # close input ASCII table (works for stdin)
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new

View File

@ -54,13 +54,14 @@ if options.stiffness == None:
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------
if filenames == []: filenames = ['STDIN'] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
if not (name == 'STDIN' or os.path.exists(name)): continue try:
table = damask.ASCIItable(name = name, outname = name+'_tmp', table = damask.ASCIItable(name = name, buffered = False)
buffered = False) except:
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name != 'STDIN' else '')) continue
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------
@ -75,7 +76,7 @@ for name in filenames:
if column < 0: remarks.append('column {} not found.'.format(options.stiffness[i])) if column < 0: remarks.append('column {} not found.'.format(options.stiffness[i]))
else: else:
columns.append(column) columns.append(column)
table.labels_append(['E{}{}{}({})'.format(*options.hkl,options.stiffness[i])) # extend ASCII header with new labels table.labels_append(['E{}{}{}({arg2})'.format(*options.hkl,arg2=options.stiffness[i])]) # extend ASCII header with new labels
if remarks != []: table.croak(remarks) if remarks != []: table.croak(remarks)
@ -94,4 +95,3 @@ for name in filenames:
# ------------------------------------------ output finalization ----------------------------------- # ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables table.close() # close ASCII tables
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new

View File

@ -122,13 +122,14 @@ for i,feature in enumerate(features):
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------
if filenames == []: filenames = ['STDIN'] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
if not (name == 'STDIN' or os.path.exists(name)): continue try:
table = damask.ASCIItable(name = name, outname = name+'_tmp', table = damask.ASCIItable(name = name, buffered = False)
buffered = False) except:
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name != 'STDIN' else '')) continue
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------
@ -219,4 +220,3 @@ for name in filenames:
# ------------------------------------------ output finalization ----------------------------------- # ------------------------------------------ output finalization -----------------------------------
table.close() # close input ASCII table (works for stdin) table.close() # close input ASCII table (works for stdin)
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new