From 153eb2f0ac8fcb6a74b106fee3c34c656e166284 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 17 Nov 2012 22:20:53 +0000 Subject: [PATCH] Some fixes in the generation of the pi files related to default parameter values. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etg/config.py | 6 +++--- etg/dataobj.py | 7 +++++-- etg/scrolwin.py | 3 ++- etgtools/extractors.py | 4 ++-- etgtools/pi_generator.py | 2 ++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/etg/config.py b/etg/config.py index e0ad8fa6..736b968b 100644 --- a/etg/config.py +++ b/etg/config.py @@ -51,18 +51,18 @@ def run(): else: func.find('defaultVal').default = 'wxEmptyString' - c.addCppMethod('long', 'ReadInt', '(const wxString& key, long defaultVal = 0)', """\ + c.addCppMethod('long', 'ReadInt', '(const wxString& key, long defaultVal=0)', """\ long rv; self->Read(*key, &rv, defaultVal); return rv; """) - c.addCppMethod('double', 'ReadFloat', '(const wxString& key, double defaultVal = 0.0)', """\ + c.addCppMethod('double', 'ReadFloat', '(const wxString& key, double defaultVal=0.0)', """\ double rv; self->Read(*key, &rv, defaultVal); return rv; """) c.find('ReadBool').ignore() - c.addCppMethod('bool', 'ReadBool', '(const wxString& key, bool defaultVal = false)', """\ + c.addCppMethod('bool', 'ReadBool', '(const wxString& key, bool defaultVal=false)', """\ bool rv; self->Read(*key, &rv, defaultVal); return rv; diff --git a/etg/dataobj.py b/etg/dataobj.py index dbf8b0af..0569b846 100644 --- a/etg/dataobj.py +++ b/etg/dataobj.py @@ -38,15 +38,18 @@ def addGetAllFormats(klass, pureVirtual=False): m = klass.findItem('GetAllFormats') if m: m.ignore() + + pyArgs = '(dir=Get)' if klass.name == 'wxDataObject' else '(dir=DataObject.Get)' klass.addCppMethod('PyObject*', 'GetAllFormats', '(wxDataObject::Direction dir=wxDataObject::Get)', cppSignature='void (wxDataFormat* formats, Direction dir)', + pyArgsString=pyArgs, isVirtual=True, isPureVirtual=pureVirtual, isConst=True, doc="""\ - Returns a list of wx.DataFormat objects which this data object supports - transfering in the given direction.""", + Returns a list of wx.DataFormat objects which this data object + supports transfering in the given direction.""", body="""\ size_t count = self->GetFormatCount(dir); wxDataFormat* formats = new wxDataFormat[count]; diff --git a/etg/scrolwin.py b/etg/scrolwin.py index 4084d613..be4d6563 100644 --- a/etg/scrolwin.py +++ b/etg/scrolwin.py @@ -61,7 +61,8 @@ def run(): # Doxygen doesn't declare the base class (the template parameter in # this case) so we can just add it here. - scrolled.bases.append('T') + # FIXED in Dox 1.8.x + #scrolled.bases.append('T') scrolled.addPrivateCopyCtor() scrolled.addPrivateAssignOp() diff --git a/etgtools/extractors.py b/etgtools/extractors.py index f762b5b5..fab28491 100644 --- a/etgtools/extractors.py +++ b/etgtools/extractors.py @@ -445,8 +445,8 @@ class FunctionDef(BaseDef): # is there a default value? default = '' if '=' in arg: - default = arg.split('=')[1] - arg = arg.split('=')[0] + default = arg.split('=')[1].strip() + arg = arg.split('=')[0].strip() if default in defValueMap: default = defValueMap.get(default) else: diff --git a/etgtools/pi_generator.py b/etgtools/pi_generator.py index eedd4d5d..0414eb98 100644 --- a/etgtools/pi_generator.py +++ b/etgtools/pi_generator.py @@ -25,6 +25,7 @@ from etgtools.tweaker_tools import removeWxPrefix, magicMethods, \ phoenixRoot = os.path.abspath(os.path.split(__file__)[0]+'/..') + header = """\ # -*- coding: utf-8 -*- #--------------------------------------------------------------------------- @@ -38,6 +39,7 @@ header = """\ #--------------------------------------------------------------------------- """ + #--------------------------------------------------------------------------- class PiWrapperGenerator(generators.WrapperGeneratorBase):