Add wxConfigPathChanger and make it be a context manager

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-11-10 23:51:58 +00:00
parent b34ac35661
commit e882826b13
2 changed files with 63 additions and 12 deletions

View File

@@ -18,7 +18,10 @@ DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [ 'wxConfigBase', 'wxFileConfig', ]
ITEMS = [ 'wxConfigBase',
'wxFileConfig',
'wxConfigPathChanger',
]
#---------------------------------------------------------------------------
@@ -79,6 +82,7 @@ def run():
#-----------------------------------------------------------------
c = module.find('wxFileConfig')
c.addPrivateCopyCtor()
c.find('wxFileConfig').findOverload('wxInputStream').ignore()
@@ -88,7 +92,7 @@ def run():
c.find('GetGlobalFile').ignore()
c.find('GetLocalFile').ignore()
#-----------------------------------------------------------------
# In C++ wxConfig is a #define to some other config class. We'll let our
# backend generator believe that it's a real class with that name. It will
# end up using the wxConfig #defined in the C++ code, and will actually be
@@ -128,6 +132,15 @@ def run():
""")
module.addItem(wc)
#-----------------------------------------------------------------
c = module.find('wxConfigPathChanger')
assert isinstance(c, etgtools.ClassDef)
c.addPrivateCopyCtor()
# context manager methods
c.addPyMethod('__enter__', '(self)', 'return self')
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'return False')
#-----------------------------------------------------------------
tools.doCommonTweaks(module)