diff --git a/processing/pre/OIMang_hex2cub.py b/processing/pre/OIMang_hex2cub.py index 73ad97810..ca7f0540a 100755 --- a/processing/pre/OIMang_hex2cub.py +++ b/processing/pre/OIMang_hex2cub.py @@ -6,8 +6,9 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] - +scriptName = os.path.splitext(scriptID.split()[1])[0] + + #-------------------------------------------------------------------------------------------------- # MAIN #-------------------------------------------------------------------------------------------------- @@ -47,8 +48,8 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') + x = 0 for line in file['input']: lineSplit=line.split() diff --git a/processing/pre/abq_addUserOutput.py b/processing/pre/abq_addUserOutput.py index f1be0070c..dc6f49b0c 100755 --- a/processing/pre/abq_addUserOutput.py +++ b/processing/pre/abq_addUserOutput.py @@ -15,7 +15,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] # ----------------------------- def ParseOutputFormat(filename,what,me): diff --git a/processing/pre/geom_addPrimitive.py b/processing/pre/geom_addPrimitive.py index 00bc27785..250ed4c26 100755 --- a/processing/pre/geom_addPrimitive.py +++ b/processing/pre/geom_addPrimitive.py @@ -6,8 +6,8 @@ import numpy as np from optparse import OptionParser import damask -scriptID = string.replace('$Id: geom_pack.py 3679 2014-11-05 22:01:11Z p.eisenlohr $','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = os.path.splitext(scriptID.split()[1])[0] oversampling = 2. @@ -92,8 +92,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') table = damask.ASCIItable(file['input'],file['output'],labels = False) table.head_read() diff --git a/processing/pre/geom_canvas.py b/processing/pre/geom_canvas.py index 1c470d6dd..1a4f536c1 100755 --- a/processing/pre/geom_canvas.py +++ b/processing/pre/geom_canvas.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] # -------------------------------------------------------------------- # MAIN @@ -68,10 +68,9 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') - theTable = damask.ASCIItable(file['input'],file['output'],labels=False) + theTable = damask.ASCIItable(file['input'],file['output'],labels = False) theTable.head_read() #--- interpret header ---------------------------------------------------------------------------- diff --git a/processing/pre/geom_check.py b/processing/pre/geom_check.py index 1b9dbb17a..924c28f52 100755 --- a/processing/pre/geom_check.py +++ b/processing/pre/geom_check.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN @@ -60,8 +60,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') theTable = damask.ASCIItable(file['input'],file['output'],labels=False) theTable.head_read() diff --git a/processing/pre/geom_fromAng.py b/processing/pre/geom_fromAng.py index f8825b6f6..378816e03 100755 --- a/processing/pre/geom_fromAng.py +++ b/processing/pre/geom_fromAng.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN diff --git a/processing/pre/geom_fromEuclideanDistance.py b/processing/pre/geom_fromEuclideanDistance.py index bd1925c21..ab916b51f 100755 --- a/processing/pre/geom_fromEuclideanDistance.py +++ b/processing/pre/geom_fromEuclideanDistance.py @@ -8,7 +8,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] def periodic_3Dpad(array, rimdim=(1,1,1)): @@ -146,8 +146,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') table = damask.ASCIItable(file['input'],file['output'][0],labels = False) table.head_read() diff --git a/processing/pre/geom_fromMinimalSurface.py b/processing/pre/geom_fromMinimalSurface.py index f0f8dd6fa..5f9f999c5 100755 --- a/processing/pre/geom_fromMinimalSurface.py +++ b/processing/pre/geom_fromMinimalSurface.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] # -------------------------------------------------------------------- # MAIN diff --git a/processing/pre/geom_fromOsteonGeometry.py b/processing/pre/geom_fromOsteonGeometry.py index f2a03d299..351038aff 100755 --- a/processing/pre/geom_fromOsteonGeometry.py +++ b/processing/pre/geom_fromOsteonGeometry.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] # -------------------------------------------------------------------- # MAIN diff --git a/processing/pre/geom_fromVPSC.py b/processing/pre/geom_fromVPSC.py index ad8bb5628..688692f35 100755 --- a/processing/pre/geom_fromVPSC.py +++ b/processing/pre/geom_fromVPSC.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN @@ -59,7 +59,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write(file['name']+'\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') info = { 'grid': np.zeros(3,'i'), diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index 289d5df4a..9af5bf214 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] def meshgrid2(*arrs): @@ -99,8 +99,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') table = damask.ASCIItable(file['input'],file['output'],buffered = False) table.head_read() diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index 369857c2c..d3c7723ec 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN @@ -52,7 +52,7 @@ else: # ------------------------------------------ loop over input files -------------------------------- for file in files: - file['croak'].write('\033[1m'+scriptName+'\033[0m'+(': '+file['name'] if file['name'] != 'STDIN' else '')+'\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') if file['name'] != 'STDIN': file['input'] = open(file['name']) diff --git a/processing/pre/geom_rescale.py b/processing/pre/geom_rescale.py index 10994afb3..5f10c2ade 100755 --- a/processing/pre/geom_rescale.py +++ b/processing/pre/geom_rescale.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN diff --git a/processing/pre/geom_translate.py b/processing/pre/geom_translate.py index 0b603cb7d..7d426ea3c 100755 --- a/processing/pre/geom_translate.py +++ b/processing/pre/geom_translate.py @@ -7,7 +7,7 @@ import damask from optparse import OptionParser scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN @@ -71,8 +71,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') theTable = damask.ASCIItable(file['input'],file['output'],labels=False) theTable.head_read() diff --git a/processing/pre/geom_unpack.py b/processing/pre/geom_unpack.py index 46342487b..7b5fd475a 100755 --- a/processing/pre/geom_unpack.py +++ b/processing/pre/geom_unpack.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN @@ -51,8 +51,7 @@ else: # ------------------------------------------ loop over input files --------------------------------- for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') table = damask.ASCIItable(file['input'],file['output'],labels = False,buffered = False) # make unbuffered ASCII_table table.head_read() # read ASCII header info diff --git a/processing/pre/geom_vicinityOffset.py b/processing/pre/geom_vicinityOffset.py index 938e471c0..f467f2b4e 100755 --- a/processing/pre/geom_vicinityOffset.py +++ b/processing/pre/geom_vicinityOffset.py @@ -8,7 +8,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- class extendedOption(Option): @@ -86,8 +86,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') theTable = damask.ASCIItable(file['input'],file['output'],labels=False) theTable.head_read() diff --git a/processing/pre/marc_addUserOutput.py b/processing/pre/marc_addUserOutput.py index 68f577836..80b26b24c 100755 --- a/processing/pre/marc_addUserOutput.py +++ b/processing/pre/marc_addUserOutput.py @@ -12,7 +12,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] # ----------------------------- def ParseOutputFormat(filename,what,me): diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index 6c294e91a..0cbd573bb 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] sys.path.append(damask.solver.Marc().libraryPath('../../')) diff --git a/processing/pre/mentat_spectralBox.py b/processing/pre/mentat_spectralBox.py index 3f810d7b7..24fcb5b8e 100755 --- a/processing/pre/mentat_spectralBox.py +++ b/processing/pre/mentat_spectralBox.py @@ -6,7 +6,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #------------------------------------------------------------------------------------------------- def outMentat(cmd,locals): diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index e16af894e..ebcf88316 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -6,7 +6,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] try: # check for Python Image Lib diff --git a/processing/pre/seeds_check.py b/processing/pre/seeds_check.py index 94bc06f19..7c017df32 100755 --- a/processing/pre/seeds_check.py +++ b/processing/pre/seeds_check.py @@ -7,7 +7,7 @@ import damask from optparse import OptionParser scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN @@ -63,8 +63,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') theTable = damask.ASCIItable(file['input'],file['output']) theTable.head_read() diff --git a/processing/pre/seeds_fromGeom.py b/processing/pre/seeds_fromGeom.py index 3deadf5b4..38e659d0e 100755 --- a/processing/pre/seeds_fromGeom.py +++ b/processing/pre/seeds_fromGeom.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- # MAIN @@ -67,8 +67,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') table = damask.ASCIItable(file['input'],file['output'],labels = False,buffered = False) table.head_read() diff --git a/processing/pre/seeds_fromRandom.py b/processing/pre/seeds_fromRandom.py index b1da2dee4..4c2c0ff6d 100755 --- a/processing/pre/seeds_fromRandom.py +++ b/processing/pre/seeds_fromRandom.py @@ -7,7 +7,7 @@ from optparse import OptionParser import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] # -------------------------------------------------------------------- # MAIN diff --git a/processing/pre/seeds_fromTable.py b/processing/pre/seeds_fromTable.py index 4cfb8df41..bc011018d 100755 --- a/processing/pre/seeds_fromTable.py +++ b/processing/pre/seeds_fromTable.py @@ -8,7 +8,7 @@ from collections import defaultdict import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = scriptID.split()[1][:-3] +scriptName = os.path.splitext(scriptID.split()[1])[0] #-------------------------------------------------------------------------------------------------- @@ -92,8 +92,7 @@ else: #--- loop over input files ------------------------------------------------------------------------ for file in files: - if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n') - else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n') + file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') table = damask.ASCIItable(file['input'],file['output'],buffered = False) table.head_read()