Skip to content

Commit

Permalink
Since they're now raising DeprecationWarnings in 4.0.2 we can drop so…
Browse files Browse the repository at this point in the history
…me method compatibility wrappers here.
  • Loading branch information
RobinD42 committed Feb 20, 2018
1 parent 4b5439d commit 3862412
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 20 deletions.
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ New and improved stuff in this release:

Other changes in this release:

*
* Many of the deprecated items in wxWidgets and wxPython are being or have
been removed. Be sure to test your code in 4.0.2 or a later 4.0.x release
with warnings enabled so you can see which class, method or function calls
you need to change.




Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/itemToModuleMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@
"DirProperty":"wx.propgrid.",
"DirSelector":"wx.",
"DirSelectorPromptStr":"wx.",
"Direction":"wx.",
"Direction":"wx.DataObject.",
"DisableAsserts":"wx.",
"Display":"wx.",
"DisplayChangedEvent":"wx.",
Expand Down
2 changes: 1 addition & 1 deletion etg/artprov.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def run():
c.find('GetBitmap').mustHaveApp()
c.find('GetIcon').mustHaveApp()

# deprecated and removed
c.find('Insert').ignore()
c.addPyCode("ArtProvider.Insert = wx.deprecated(ArtProvider.PushBack, 'Use ArtProvider.PushBack instead')")

# Change the types of the art constants from wxString to const char*
# since that is what they really are.
Expand Down
4 changes: 1 addition & 3 deletions etg/combo.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ def run():
c.find('SetSelection.from').name = 'frm'


# deprecated and removed
c.find('GetTextIndent').ignore()
c.find('SetTextIndent').ignore()
c.addPyCode("ComboCtrl.GetTextIndent = wx.deprecated(ComboCtrl.GetMargins, 'Use GetMargins instead.')")
c.addPyCode("ComboCtrl.SetTextIndent = wx.deprecated(ComboCtrl.SetMargins, 'Use SetMargins instead.')")


#-----------------------------------------------------------------
tools.doCommonTweaks(module)
Expand Down
3 changes: 2 additions & 1 deletion etg/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,9 @@ def run():
#---------------------------------------
# wxIconizeEvent
c = module.find('wxIconizeEvent')

# deprecated and removed
c.find('Iconized').ignore()
c.addPyCode("IconizeEvent.Iconized = wx.deprecated(IconizeEvent.IsIconized, 'Use IsIconized instead')")



Expand Down
3 changes: 1 addition & 2 deletions etg/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,9 @@ def addTransferAnnotations(c, arg):
c.addPyProperty('Menus GetMenus SetMenus')


# deprecated and removed
c.find('GetLabelTop').ignore()
c.find('SetLabelTop').ignore()
c.addPyCode("MenuBar.GetLabelTop = wx.deprecated(MenuBar.GetMenuLabelText, 'Use GetMenuLabelText instead')")
c.addPyCode("MenuBar.SetLabelTop = wx.deprecated(MenuBar.SetMenuLabel, 'Use SetMenuLabel instead')")

module.addItem(tools.wxListWrapperTemplate('wxMenuList', 'wxMenu', module))

Expand Down
7 changes: 1 addition & 6 deletions etg/menuitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,13 @@ def run():

c.find('SetSubMenu.menu').transfer = True

# deprecated and removed
c.find('GetLabel').ignore()
c.find('GetName').ignore()
c.find('GetText').ignore()
c.find('SetText').ignore()
c.find('GetLabelFromText').ignore()

c.addPyCode("MenuItem.GetLabel = wx.deprecated(MenuItem.GetItemLabelText, 'Use GetItemLabelText instead')")
c.addPyCode("MenuItem.GetName = wx.deprecated(MenuItem.GetItemLabelText, 'Use GetItemLabelText instead')")
c.addPyCode("MenuItem.GetText = wx.deprecated(MenuItem.GetItemLabel, 'Use GetItemLabel instead')")
c.addPyCode("MenuItem.SetText = wx.deprecated(MenuItem.SetItemLabel, 'Use SetItemLabel instead')")
c.addPyCode("MenuItem.GetLabelFromText = wx.deprecated(MenuItem.GetLabelText, 'Use GetLabelText instead')")


# These are MSW only. Make them be empty stubs for the other ports
c.find('GetBackgroundColour').type = 'wxColour*'
Expand Down
4 changes: 1 addition & 3 deletions etg/propgridproperty.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ def run():

c.find('GetEditorDialog').factory = True


# deprecated and removed
c.find('AddChild').ignore()
c.find('GetValueString').ignore()
c.addPyCode("PGProperty.AddChild = wx.deprecated(PGProperty.AddPrivateChild, 'Use AddPrivateChild instead')")
c.addPyCode("PGProperty.GetValueString = wx.deprecated(PGProperty.GetValueAsString, 'Use GetValueAsString instead')")


#---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion etg/sizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def run():
# Needs wxWin 2.6 compatibility
c.find('Remove').findOverload('(wxWindow *window)').ignore()

# deprecated and removed
c.find('SetVirtualSizeHints').ignore()
c.addPyCode("Sizer.SetVirtualSizeHints = wx.deprecated(Sizer.FitInside, 'Use FitInside instead')")

c.addPyMethod('AddMany', '(self, items)',
doc="""\
Expand Down
2 changes: 1 addition & 1 deletion etg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def run():
module.find('wxSetDisplayName').ignore()
module.find('wxPostDelete').ignore()

# deprecated and removed
module.find('wxUsleep').ignore()
module.addPyCode("Usleep = deprecated(MilliSleep, 'Use MilliSleep instead.')")


# ignore all the environment related functions
Expand Down

0 comments on commit 3862412

Please sign in to comment.