From cceffdf07d9471669cd4f4e45f43b4697a507f3b Mon Sep 17 00:00:00 2001 From: omircescu Date: Thu, 17 Oct 2013 11:33:58 +0000 Subject: [PATCH] =?utf8?q?PAL=20issue=202757:=20Traiter=20de=20mani=C3=83?= =?utf8?q?=C2=A8re=20masqu=C3=83=C2=A9e=20l=C3=A2=C2=80=C2=99ex=C3=83?= =?utf8?q?=C2=A9cution=20de=20la=20commande=20DEBUT=20d=C3=A2=C2=80=C2=99u?= =?utf8?q?n=20script=20de=20commande=20ASTER?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- module_generator/aster_tmpl.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/module_generator/aster_tmpl.py b/module_generator/aster_tmpl.py index 629c383..63f6c44 100644 --- a/module_generator/aster_tmpl.py +++ b/module_generator/aster_tmpl.py @@ -76,8 +76,15 @@ ${servicesimpl} asterCompo=Template(asterCompo) asterCEXECompo=""" +# Par rapport a la version precedente +# Chaque service est complete par l'appel initial a Complement +# Cette methode rajoute a l'appel du premier service de l'instance un prefixe au fichier de commande +# Ce prefixe est fourni dans le fichier fort.99 via as_run et exeaster +# Le fichier est lu a la creation du module +# Interet: introduire DEBUT() dans ce prefixe pour ne plus avoir a s'en preoccuper (ex: boucle for each) import sys,traceback,os import string +import cPickle import ${module}_ORB__POA import calcium import dsccalcium @@ -106,12 +113,32 @@ class ${component}(${module}_ORB__POA.${component},dsccalcium.PyDSCComponent,SUP ''' def __init__ ( self, orb, poa, contID, containerName, instanceName, interfaceName ): self.init=0 + if os.path.isfile('fort.99'): + prefixFile = file("fort.99","r") + self.prefixJdc = prefixFile.read() + prefixFile.close() + else: + self.prefixJdc = "" dsccalcium.PyDSCComponent.__init__(self, orb, poa,contID,containerName,instanceName,interfaceName) def init_service(self,service): ${initservice} return False + def insertPrefix(self,jdc): + if not self.init: + jdc = self.prefixJdc + jdc + return jdc + + def insertPrePost(self,jdc,prepost): + if prepost <> "": + exec(prepost) + try: + jdc = os.linesep + pre + os.linesep + jdc + os.linesep + post + os.linesep + except NameError: + pass + return jdc + def interpstring(self,text,args): try: self.jdc.g_context.update(args) @@ -254,6 +281,9 @@ asterCEXEService=""" jdc=fcomm.read() fcomm.close() #args["jdc"]=jdc + prepost = '''${body}''' + jdc = self.insertPrePost(jdc,prepost) + jdc = self.insertPrefix(jdc) if not self.init: self.init=1 fcomm=open("fort.1",'w') -- 2.39.2