]> SALOME platform Git repositories - tools/yacsgen.git/commitdiff
Salome HOME
CCAR: small bug with python executable component V5_1_4a1
authorcaremoli <caremoli>
Tue, 6 Apr 2010 12:12:29 +0000 (12:12 +0000)
committercaremoli <caremoli>
Tue, 6 Apr 2010 12:12:29 +0000 (12:12 +0000)
module_generator/pycompo.py

index e910a240be8140cf0f5563b2b958c53e2f260e32..a6f90421f3cc8cdf9d97512fc1fbef53a4f677c5 100644 (file)
@@ -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)