mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
We can now use PyObject* instead of SIP_PYOBJECT
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -453,9 +453,13 @@ from %s import *
|
||||
pnames = ', '.join(pnames)
|
||||
if pnames:
|
||||
pnames = ', ' + pnames
|
||||
# convert PyObject* to SIP_PYOBJECT in the return type and param types
|
||||
typ = method.type.replace('PyObject*', 'SIP_PYOBJECT')
|
||||
argsString = method.argsString.replace('PyObject*', 'SIP_PYOBJECT')
|
||||
if False:
|
||||
# convert PyObject* to SIP_PYOBJECT in the return type and param types
|
||||
typ = method.type.replace('PyObject*', 'SIP_PYOBJECT')
|
||||
argsString = method.argsString.replace('PyObject*', 'SIP_PYOBJECT')
|
||||
else:
|
||||
typ = method.type
|
||||
argsString = method.argsString
|
||||
# spit it all out
|
||||
if method.isCtor:
|
||||
stream.write('%s%s%s%s;\n' %
|
||||
|
||||
@@ -16,6 +16,7 @@ import extractors
|
||||
import sys, os
|
||||
|
||||
|
||||
|
||||
def removeWxPrefixes(node):
|
||||
"""
|
||||
Rename items with a 'wx' prefix to not have the prefix. If the back-end
|
||||
@@ -36,7 +37,12 @@ def removeWxPrefixes(node):
|
||||
item.pyName = item.name
|
||||
|
||||
|
||||
|
||||
def removeWxPrefix(name):
|
||||
if name.startswith('wx') and not name.startswith('wxEVT_'):
|
||||
name = name[2:]
|
||||
return name
|
||||
|
||||
|
||||
def ignoreAssignmentOperators(node):
|
||||
"""
|
||||
Set the ignored flag for all class methods that are assignment operators
|
||||
@@ -423,7 +429,8 @@ def convertFourDoublesTemplate(CLASS):
|
||||
def wxListWrapperTemplate(ListClass, ItemClass, RealItemClass=None):
|
||||
if RealItemClass is None:
|
||||
RealItemClass = ItemClass
|
||||
|
||||
ListClass_noPrefix = removeWxPrefix(ListClass)
|
||||
|
||||
# *** TODO: This can probably be done in a way that is not SIP-specfic. Try
|
||||
# creating extractor objects from scratch and attach cppMethods to them.
|
||||
|
||||
@@ -499,10 +506,10 @@ public:
|
||||
}};
|
||||
|
||||
%Extract(id=pycode)
|
||||
def _{ListClass}___repr__(self):
|
||||
def _{ListClass_noPrefix}___repr__(self):
|
||||
return "{ListClass}: " + repr(list(self))
|
||||
{ListClass}.__repr__ = _{ListClass}___repr__
|
||||
del _{ListClass}___repr__
|
||||
{ListClass_noPrefix}.__repr__ = _{ListClass_noPrefix}___repr__
|
||||
del _{ListClass_noPrefix}___repr__
|
||||
%End
|
||||
'''.format(**locals()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user