From: Ovidiu Mircescu Date: Fri, 16 Jun 2017 14:58:58 +0000 (+0200) Subject: Fix copy of salome_context.cfg when the application is generated. X-Git-Tag: V8_4_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=326b21d6781deb517f2a0f1d5bdc6d4ec81e29ea;p=tools%2Fyacsgen.git Fix copy of salome_context.cfg when the application is generated. --- diff --git a/module_generator/gener.py b/module_generator/gener.py index d164938..38a9e90 100644 --- a/module_generator/gener.py +++ b/module_generator/gener.py @@ -925,15 +925,22 @@ ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR}) #add the generated module modules.append(' ' % (self.module.name, os.path.abspath(self.module.prefix))) - + ROOT_SALOME=os.getenv("ROOT_SALOME") #try to find a prerequisites file prerequisites = self.context.get("prerequisites") if not prerequisites: #try to find one in rootdir - prerequisites = os.path.join(rootdir, "profile%s.sh" % suffix) + prerequisites = os.path.join(ROOT_SALOME, "salome_prerequisites.sh") if not os.path.exists(prerequisites): raise Invalid("Can not create an application : prerequisites file not defined or does not exist") + salome_context = self.context.get("salome_context") + if not salome_context: + #try to find one in rootdir + salome_context = os.path.join(ROOT_SALOME, "salome_context.cfg") + if not os.path.exists(salome_context): + raise Invalid("Can not create an application : salome_context file not defined or does not exist") + #add resources catalog if it exists resources_spec="" if os.path.isfile(resources): @@ -941,6 +948,7 @@ ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR}) #create config_appli.xml file appli = application.substitute(prerequisites=prerequisites, + context=salome_context, modules="\n".join(modules), resources=resources_spec) fil = open(os.path.join(appliname, "config_appli.xml"), 'w') diff --git a/module_generator/mod_tmpl.py b/module_generator/mod_tmpl.py index 793377a..3767e52 100644 --- a/module_generator/mod_tmpl.py +++ b/module_generator/mod_tmpl.py @@ -25,6 +25,7 @@ except: application=""" + ${resources} ${modules}