Allow cppSignature and pyArgsString for CppMethods too

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-11-09 04:38:43 +00:00
parent 50ac718d47
commit e8d7197917
3 changed files with 11 additions and 6 deletions

View File

@@ -942,7 +942,7 @@ class ClassDef(BaseDef):
"""
md = CppMethodDef_sip('', self.name, argsString, body, doc=doc,
isCtor=True, klass=self, noDerivedCtor=noDerivedCtor,
cppSignature=None, **kw)
cppSignature=cppSignature, **kw)
self._addMethod(md)
return md

View File

@@ -423,7 +423,11 @@ class PiWrapperGenerator(generators.WrapperGeneratorBase):
def generateMethod(self, method, stream, indent, name=None, docstring=None):
assert isinstance(method, extractors.MethodDef)
if method.ignored:
for m in method.all(): # use the first not ignored if there are overloads
if not m.ignored:
method = m
break
else:
return
if method.isDtor:
return

View File

@@ -832,13 +832,14 @@ from .%s import *
assert isinstance(method, extractors.CppMethodDef_sip)
if method.ignored:
return
cppSig = " [ %s ]" % method.cppSignature if method.cppSignature else ""
if method.isCtor:
stream.write('%s%s%s%s;\n' %
(indent, method.name, method.argsString, self.annotate(method)))
stream.write('%s%s%s%s%s;\n' %
(indent, method.name, method.argsString, self.annotate(method), cppSig))
else:
stream.write('%s%s %s%s%s;\n' %
stream.write('%s%s %s%s%s%s;\n' %
(indent, method.type, method.name, method.argsString,
self.annotate(method)))
self.annotate(method), cppSig))
stream.write('%s%%MethodCode\n' % indent)
stream.write(nci(method.body, len(indent)+4))
stream.write('%s%%End\n\n' % indent)