-
- if self.version < (10,1,2):
- #patch to E_SUPERV.py
- fil = open(os.path.join(self.aster_dir, "bibpyt", "Execution", "E_SUPERV.py"))
- esuperv = fil.read()
- fil.close()
- esuperv = re.sub("def Execute\(self\)", "def Execute(self, params)", esuperv)
- esuperv = re.sub("j=self.JdC", "self.jdc=j=self.JdC", esuperv)
- esuperv = re.sub("\*\*args", "context_ini=params, **args", esuperv)
- esuperv = re.sub("def main\(self\)", "def main(self,params={})", esuperv)
- esuperv = re.sub("return self.Execute\(\)", "return self.Execute(params)", esuperv)
- fdict["E_SUPERV.py"]=esuperv
-
- #use a specific main program
- config = ""
- path_config = os.path.join(self.aster_dir, "config.txt")
- if os.path.exists(path_config) :
- # old aster version - old mechanism kept for compatibility
- fil = open(path_config)
- config = fil.read()
- fil.close()
- config = re.sub(" profile.sh", os.path.join(self.aster_dir, "profile.sh"), config)
- path=os.path.join(os.path.abspath(gen.module.prefix),'lib',
- 'python%s.%s' % (sys.version_info[0], sys.version_info[1]),
- 'site-packages','salome','%s_container.py' % self.name)
- config = re.sub("Execution\/E_SUPERV.py", path, config)
- else :
- # getConfig doesn't work with older versions of aster
- config = self.getConfig(gen)
-