M0ve the call to addAutoProperties into the doCommonTweaks function, but make it not generate the auto properties if there are already properties in the class or the class explicitly clears the alllowAutoProperties flag, turning it off.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-10-24 21:35:29 +00:00
parent 54520f7a3a
commit 766baba0a6
52 changed files with 17 additions and 51 deletions

View File

@@ -102,7 +102,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -74,7 +74,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -35,7 +35,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -38,7 +38,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -87,7 +87,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -42,7 +42,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -45,7 +45,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -54,7 +54,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -130,7 +130,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -39,7 +39,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -82,7 +82,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -52,7 +52,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -60,7 +60,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -225,7 +225,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -45,7 +45,6 @@ def run():
#-----------------------------------------------------------------
tools.addAutoProperties(module)
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -58,7 +58,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -36,7 +36,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -67,7 +67,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -38,7 +38,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -225,7 +225,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -43,7 +43,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -62,7 +62,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -58,7 +58,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -106,7 +106,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -121,7 +121,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -114,7 +114,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -57,7 +57,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -37,7 +37,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -40,7 +40,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -53,7 +53,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -17,7 +17,9 @@ DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [ 'wxProcess' ]
ITEMS = [ 'wxProcess',
'wxProcessEvent',
]
#---------------------------------------------------------------------------
@@ -32,6 +34,7 @@ def run():
module.addPyCode('EVT_END_PROCESS = wx.PyEventBinder( wxEVT_END_PROCESS )')
#-----------------------------------------------------------------

View File

@@ -43,7 +43,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -37,7 +37,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -52,7 +52,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -39,7 +39,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -78,7 +78,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -42,7 +42,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -35,7 +35,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -39,7 +39,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -38,7 +38,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -35,7 +35,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -37,7 +37,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -35,7 +35,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -52,7 +52,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -58,7 +58,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -55,7 +55,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -37,7 +37,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -60,11 +60,14 @@ def run():
if 'Env' in item.name:
item.ignore()
module.find('wxGetenv').ignore()
# Keep just the first wxExecute overload
f = module.find('wxExecute')
f.overloads = []
module.find('wxGetOsVersion.major').out = True
module.find('wxGetOsVersion.minor').out = True
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -38,7 +38,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -503,6 +503,7 @@ class ClassDef(BaseDef):
self.external = False # class is in another module
self.noDefCtor = False # do not generate a default constructor
self.singlton = False # class is a singleton so don't call the dtor until the interpreter exits
self.allowAutoProperties = True
self.headerCode = []
self.cppCode = []
self.convertToPyObject = None

View File

@@ -61,7 +61,6 @@ def run():
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)
tools.runGenerators(module)

View File

@@ -68,10 +68,16 @@ def ignoreAllOperators(node):
def addAutoProperties(node):
"""
Call klass.addAutoProperties for all classes in node.
Call klass.addAutoProperties for all classes in node with
allowAutoProperties set and which do not already have properties added by
hand in the tweaker code.
"""
for item in node.allItems():
if isinstance(item, extractors.ClassDef):
if not item.allowAutoProperties:
continue
if len([i for i in item if isinstance(i, extractors.PropertyDef)]):
continue
item.addAutoProperties()
@@ -274,6 +280,7 @@ def doCommonTweaks(module):
"""
ignoreAssignmentOperators(module)
removeWxPrefixes(module)
addAutoProperties(module)
def changeTypeNames(module, oldName, newName, skipTypedef=False):