adoption of new ASCIItable API

This commit is contained in:
Philip Eisenlohr 2015-08-18 14:37:32 +00:00
parent ca1fe6bb82
commit 70daa8663f
7 changed files with 42 additions and 42 deletions

View File

@ -38,13 +38,14 @@ if len(options.label) == 0:
# --- 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 ------------------------------------------
@ -94,4 +95,3 @@ for name in filenames:
# ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new

View File

@ -34,13 +34,14 @@ parser.set_defaults(label = [],
# --- 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 ------------------------------------------
@ -85,4 +86,3 @@ for name in filenames:
# ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new

View File

@ -51,13 +51,14 @@ R = q.asMatrix()
# --- 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 ------------------------------------------
@ -115,4 +116,3 @@ for name in filenames:
# ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new

View File

@ -38,13 +38,14 @@ if len(options.label) != len(options.factor):
# --- 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 ------------------------------------------
@ -86,4 +87,3 @@ for name in filenames:
# ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new

View File

@ -38,13 +38,14 @@ if len(options.label) != len(options.delta):
# --- 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 ------------------------------------------
@ -86,4 +87,3 @@ for name in filenames:
# ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new

View File

@ -59,13 +59,14 @@ parser.set_defaults(head = False,
# --- 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 = None,
buffered = False, labeled = options.labeled, readonly = True)
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name != 'STDIN' else ''))
try:
table = damask.ASCIItable(name = name,
buffered = False, labeled = options.labeled, readonly = True)
except: continue
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
# ------------------------------------------ output head ---------------------------------------

View File

@ -43,13 +43,14 @@ options.keys.reverse()
# --- 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 ''))
# ------------------------------------------ assemble header ---------------------------------------
@ -77,5 +78,3 @@ for name in filenames:
table.data = table.data[ind]
table.data_writeArray()
table.close() # close ASCII table
if name != 'STDIN': os.rename(name+'_tmp',name) # overwrite old one with tmp new