had badly messed up the file handling in commit 3630. STDIN did not work, files were not checked for existence…
This commit is contained in:
parent
60f939d8f5
commit
f6741138e7
|
@ -34,16 +34,18 @@ parser.set_defaults(condition = '')
|
||||||
|
|
||||||
(options,filenames) = parser.parse_args()
|
(options,filenames) = parser.parse_args()
|
||||||
|
|
||||||
|
if filenames == []:
|
||||||
|
filenames = ['STDIN']
|
||||||
|
|
||||||
#--- loop over input files -------------------------------------------------------------------------
|
#--- loop over input files -------------------------------------------------------------------------
|
||||||
for name in filenames:
|
for name in filenames:
|
||||||
if name != 'STDIN':
|
if name == 'STDIN':
|
||||||
file = {'name':name, 'input':open(name), 'output':open(name+'_tmp','w'), 'croak':sys.stderr}
|
|
||||||
file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n')
|
|
||||||
else:
|
|
||||||
if not os.path.exists(name): continue
|
|
||||||
file = {'name':'STDIN', 'input':sys.stdin, 'output':sys.stdout, 'croak':sys.stderr}
|
file = {'name':'STDIN', 'input':sys.stdin, 'output':sys.stdout, 'croak':sys.stderr}
|
||||||
file['croak'].write('\033[1m'+scriptName+'\033[0m\n')
|
file['croak'].write('\033[1m'+scriptName+'\033[0m\n')
|
||||||
|
else:
|
||||||
|
if not os.path.exists(name): continue
|
||||||
|
file = {'name':name, 'input':open(name), 'output':open(name+'_tmp','w'), 'croak':sys.stderr}
|
||||||
|
file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n')
|
||||||
|
|
||||||
table = damask.ASCIItable(file['input'],file['output'],False) # make unbuffered ASCII_table
|
table = damask.ASCIItable(file['input'],file['output'],False) # make unbuffered ASCII_table
|
||||||
table.head_read() # read ASCII header info
|
table.head_read() # read ASCII header info
|
||||||
|
|
Loading…
Reference in New Issue