From 4cac885bd01236da2656e7df6a38750338a8eb83 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 3 Nov 2011 12:59:51 +0000 Subject: [PATCH] added function to find out shared library path of most recent Mentat release --- lib/msc_tools.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/msc_tools.py b/lib/msc_tools.py index 35da5b30d..0a99d571e 100644 --- a/lib/msc_tools.py +++ b/lib/msc_tools.py @@ -1,5 +1,36 @@ class MSC_TOOLS(): import os,string + + releases = { \ + '2010.2':['linux64',''], + '2010': ['linux64',''], + '2008r1':[''], + '2007r1':[''], + '2005r3':[''], + } + + def library_paths(self): + import os + + thePath = '' + try: # check for MSC.Mentat installation location + file = open(os.path.join(os.getenv('DAMASK_ROOT'),'lib/pathinfo')) + for line in file.readlines(): + if line.split()[0] == 'MSC': MSCpath = os.path.normpath(line.split()[1]) + file.close() + except: + MSCpath = '/msc' + + for release,subdirs in sorted(self.releases.items(),reverse=True): + for subdir in subdirs: + libPath = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir) + if os.path.exists(libPath): + thePath = libPath + break + else: + continue + break + return thePath def submit_job(self, run_marc_path='/msc/marc2010/tools/',