From: ribes Date: Wed, 14 Mar 2012 15:39:31 +0000 (+0000) Subject: Adding prerequisites SALOME in the environment of ASTER X-Git-Tag: V6_5_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c0d46101f0dae829cc42a570d5194d2369e503fd;p=tools%2Fyacsgen.git Adding prerequisites SALOME in the environment of ASTER --- diff --git a/module_generator/astcompo.py b/module_generator/astcompo.py index 062f26a..098487b 100644 --- a/module_generator/astcompo.py +++ b/module_generator/astcompo.py @@ -182,6 +182,7 @@ class ASTERComponent(Component): 'python%s.%s' % (sys.version_info[0], sys.version_info[1]), 'site-packages','salome','%s_component.py'%self.name) config = re.sub("Execution\/E_SUPERV.py", path, config) + config += "ENV_SH | env | - | " + self.prerequisites + "\n" fdict["%s_config.txt" % self.name] = config fdict["%s_component.py" % self.name] = component.substitute(component=self.name) @@ -214,6 +215,7 @@ class ASTERComponent(Component): '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) + config += "ENV_SH | env | - | " + self.prerequisites + "\n" fdict["%s_container.py" % self.name] = container fdict["%s_config.txt" % self.name] = config diff --git a/module_generator/gener.py b/module_generator/gener.py index 9d425f2..c8724dd 100644 --- a/module_generator/gener.py +++ b/module_generator/gener.py @@ -160,6 +160,9 @@ class Component(object): def getMakefileItems(self,gen): return {} + def setPrerequisites(self, prerequisites_file): + self.prerequisites = prerequisites_file + class Service(object): """ A :class:`Service` instance represents a component service with dataflow and datastream ports. @@ -311,6 +314,8 @@ class Generator(object): self.aster = "" if self.module.gui and not self.gui: raise Invalid("To generate a module with GUI, you need to set the 'gui' parameter in the context dictionnary") + for component in self.module.components: + component.setPrerequisites(self.context.get("prerequisites")) def generate(self): """Generate a SALOME source module"""