diff --git a/processing/post/mentat_colorMap b/processing/post/mentat_colorMap index 5a04e9833..f5efc20b9 100755 --- a/processing/post/mentat_colorMap +++ b/processing/post/mentat_colorMap @@ -1,36 +1,15 @@ #!/usr/bin/env python -import sys, os +import sys, os, msc_tools from colorsys import * from optparse import OptionParser -releases = {'2010':['linux64',''], - '2008r1':[''], - '2007r1':[''], - '2005r3':[''], - } - -try: - file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0]))) - MSCpath = os.path.normpath(file.readline().strip()) - file.close() -except: - MSCpath = '/msc' - -for release,subdirs in sorted(releases.items(),reverse=True): - for subdir in subdirs: - libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir) - if os.path.exists(libPath): - sys.path.append(libPath) - break - else: - continue - break +sys.path.append(msc_tools.MSC_TOOLS().library_paths()) try: from py_mentat import * except: - print('warning: no valid Mentat release found in %s'%MSCpath) + print('warning: no valid Mentat release found') # ----------------------------- @@ -135,7 +114,9 @@ For symmetric scales use option "-s". Example colors: - Non-symmetric scales: 0.167,0.9,0.1 0.167,0.1,0.9 - Symmetric scales: 0,0.2,0.9 0.333,0.2,0.9 -""") +""" + string.replace('$Id$','\n','\\n') +) + parser.add_option("-s","--symmetric", action = "store_true", dest = "symmetric", \ diff --git a/processing/pre/mentat_pbcOnBoxMesh b/processing/pre/mentat_pbcOnBoxMesh index 57a38b24d..35ac29f7f 100755 --- a/processing/pre/mentat_pbcOnBoxMesh +++ b/processing/pre/mentat_pbcOnBoxMesh @@ -1,36 +1,14 @@ #!/usr/bin/env python -import sys,os,pwd,math,re,string -#import Image,ImageDraw +import sys,os,pwd,math,re,string,msc_tools from optparse import OptionParser -releases = {'2010':['linux64',''], - '2008r1':[''], - '2007r1':[''], - '2005r3':[''], - } - -try: - file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0]))) - MSCpath = os.path.normpath(file.readline().strip()) - file.close() -except: - MSCpath = '/msc' - -for release,subdirs in sorted(releases.items(),reverse=True): - for subdir in subdirs: - libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir) - if os.path.exists(libPath): - sys.path.append(libPath) - break - else: - continue - break +sys.path.append(msc_tools.MSC_TOOLS().library_paths()) try: from py_mentat import * except: - print('error: no valid Mentat release found in %s'%MSCpath) + print('error: no valid Mentat release found') sys.exit(-1) @@ -167,7 +145,7 @@ def servoLink(): parser = OptionParser(usage='%prog [options]', description = """ Set up servo linking to achieve periodic boundary conditions for a regular hexahedral mesh presently opened in MSC.Mentat -""" + string.replace('$Id: spectral_iterationCount 919 2011-06-15 18:14:05Z MPIE\p.eisenlohr $','\n','\\n') +""" + string.replace('$Id$','\n','\\n') ) parser.add_option("-p", "--port", type="int",\ diff --git a/processing/pre/mentat_spectralBox b/processing/pre/mentat_spectralBox index 8f2e393ff..81ef094ca 100755 --- a/processing/pre/mentat_spectralBox +++ b/processing/pre/mentat_spectralBox @@ -1,13 +1,8 @@ #!/usr/bin/env python -import os, sys, math, re, threading, time, string +import os, sys, math, re, threading, time, string, msc_tools from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP -releases = {'2010':['linux64',''], - '2008r1':[''], - '2007r1':[''], - '2005r3':[''], - } # ----------------------- FUNCTIONS ---------------------------- @@ -256,27 +251,12 @@ parser.set_defaults(homogenization = 1) (options, args) = parser.parse_args() -try: - file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0]))) - MSCpath = os.path.normpath(file.readline().strip()) - file.close() -except: - MSCpath = '/msc' - -for release,subdirs in sorted(releases.items(),reverse=True): - for subdir in subdirs: - libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir) - if os.path.exists(libPath): - sys.path.append(libPath) - break - else: - continue - break +sys.path.append(msc_tools.MSC_TOOLS().library_paths()) try: from py_mentat import * except: - print('no valid Mentat release found in %s'%MSCpath) + print('no valid Mentat release found') if options.port != None: sys.exit(-1) if not os.path.isfile(args[0]): diff --git a/processing/pre/patchFromReconstructedBoundaries b/processing/pre/patchFromReconstructedBoundaries old mode 100644 new mode 100755 index df9be8ad9..88924f98f --- a/processing/pre/patchFromReconstructedBoundaries +++ b/processing/pre/patchFromReconstructedBoundaries @@ -1,6 +1,6 @@ #!/usr/bin/env python -import sys,os,math,re,string +import sys,os,math,re,string, msc_tools from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP @@ -10,27 +10,7 @@ try: # check for Python Image Lib except: ImageCapability = False -try: # check for MSC.Mentat installation location - file = open('%s/../MSCpath'%os.path.dirname(os.path.realpath(sys.argv[0]))) - MSCpath = os.path.normpath(file.readline().strip()) - file.close() -except: - MSCpath = '/msc' - -releases = {'2010':['linux64',''], - '2008r1':[''], - '2007r1':[''], - '2005r3':[''], - } -for release,subdirs in sorted(releases.items(),reverse=True): - for subdir in subdirs: - libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir) - if os.path.exists(libPath): - sys.path.append(libPath) - break - else: - continue - break +sys.path.append(msc_tools.MSC_TOOLS().library_paths()) try: # check for MSC.Mentat Python interface from py_mentat import * @@ -794,7 +774,7 @@ parser = OptionParser(option_class=extendedOption, usage='%prog [options] datafi Produce image, spectral geometry description, and (auto) Mentat procedure from TSL/OIM reconstructed boundary file -""" + string.replace('$Id: spectral_iterationCount 919 2011-06-15 18:14:05Z MPIE\p.eisenlohr $','\n','\\n') +""" + string.replace('$Id$','\n','\\n') ) parser.add_option("-o", "--output", action='extend', dest='output', type='string', \