From: caremoli Date: Tue, 6 Apr 2010 12:12:29 +0000 (+0000) Subject: CCAR: small bug with python executable component X-Git-Tag: V5_1_4a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6ed4fe39353cf4da7ab3aece310994a63da4afad;p=tools%2Fyacsgen.git CCAR: small bug with python executable component --- diff --git a/module_generator/pycompo.py b/module_generator/pycompo.py index e910a24..a6f9042 100644 --- a/module_generator/pycompo.py +++ b/module_generator/pycompo.py @@ -169,11 +169,19 @@ class PYComponent(Component): inits.append(init) python_path = ",".join([repr(p) for p in self.python_path]) - return pyCompoEXE.substitute(component=self.name, module=gen.module.name, - servicesdef="\n".join(defs), - servicesimpl="\n".join(services), - initservice='\n'.join(inits), - python_path=python_path) + inheritedclass=self.inheritedclass + callconstructor="" + if self.inheritedclass: + inheritedclass= self.inheritedclass + "," + callconstructor=""" + if hasattr(%s,"__init__"): + %s.__init__(self)""" % (self.inheritedclass,self.inheritedclass) + return pyCompoEXE.substitute(component=self.name, module=gen.module.name, + servicesdef="\n".join(defs), + servicesimpl="\n".join(services), + initservice='\n'.join(inits), + python_path=python_path,inheritedclass=inheritedclass, + compodefs=self.compodefs, callconstructor=callconstructor)