Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit deeeeb6

Browse files
ensure Toolbar alias, but with deprecation warning
1 parent 3a50249 commit deeeeb6

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

lib/matplotlib/backends/backend_wx.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from matplotlib.backend_bases import _has_pil
3535

3636
from matplotlib._pylab_helpers import Gcf
37-
from matplotlib.cbook import is_writable_file_like, warn_deprecated, deprecated
37+
from matplotlib.cbook import is_writable_file_like, warn_deprecated
3838
from matplotlib.figure import Figure
3939
from matplotlib.path import Path
4040
from matplotlib.transforms import Affine2D
@@ -1474,7 +1474,7 @@ def updateButtonText(self, lst):
14741474
}
14751475

14761476

1477-
@deprecated("2.2")
1477+
@cbook.deprecated("2.2")
14781478
class SubplotToolWX(wx.Frame):
14791479
def __init__(self, targetfig):
14801480
wx.Frame.__init__(self, None, -1, "Configure subplots")
@@ -1700,6 +1700,11 @@ def set_history_buttons(self):
17001700
self.EnableTool(self.wx_ids['Forward'], can_forward)
17011701

17021702

1703+
@cbook.deprecated("2.2", alternative="NavigationToolbar2Wx")
1704+
class Toolbar(NavigationToolbar2Wx):
1705+
pass
1706+
1707+
17031708
class StatusBarWx(wx.StatusBar):
17041709
"""
17051710
A status bar is added to _FigureFrame to allow measurements and the
@@ -1957,15 +1962,6 @@ def OnPrintPage(self, page):
19571962
return True
19581963
# >
19591964

1960-
########################################################################
1961-
#
1962-
# Now just provide the standard names that backend.__init__ is expecting
1963-
#
1964-
########################################################################
1965-
1966-
1967-
Toolbar = NavigationToolbar2Wx
1968-
19691965

19701966
@_Backend.export
19711967
class _BackendWx(_Backend):

lib/matplotlib/backends/backend_wxagg.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import wx
77

88
import matplotlib
9+
from matplotlib import cbook
910
from . import wx_compat as wxc
1011
from .backend_agg import FigureCanvasAgg
1112
from .backend_wx import (
@@ -71,6 +72,11 @@ def blit(self, bbox=None):
7172
filetypes = FigureCanvasAgg.filetypes
7273

7374

75+
@cbook.deprecated("2.2", alternative="NavigationToolbar2WxAgg")
76+
class Toolbar(NavigationToolbar2WxAgg):
77+
pass
78+
79+
7480
# agg/wxPython image conversion functions (wxPython >= 2.8)
7581

7682
def _convert_agg_to_wx_image(agg, bbox):

0 commit comments

Comments
 (0)