Repository navigation
Fix Wx inconsistencies #10518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Wx inconsistencies #10518
Changes from 2 commits
fa3209e
015db3e
3a50249
deeeeb6
9d369a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,8 @@ | |
| from .. import cbook | ||
| from . import wx_compat as wxc | ||
| from .backend_agg import FigureCanvasAgg | ||
| from .backend_wx import ( | ||
| _BackendWx, _FigureCanvasWxBase, FigureFrameWx, NavigationToolbar2Wx) | ||
| from .backend_wx import _BackendWx, _FigureCanvasWxBase, FigureFrameWx | ||
| from .backend_wx import NavigationToolbar2Wx as NavigationToolbar2WxAgg | ||
|
|
||
|
|
||
| class FigureFrameWxAgg(FigureFrameWx): | ||
|
|
@@ -71,15 +71,8 @@ def blit(self, bbox=None): | |
| filetypes = FigureCanvasAgg.filetypes | ||
|
|
||
|
|
||
| @cbook.deprecated("2.2") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please leave until 3.0 (one minor-release deprecation period at least, usually two).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see that any other NavigationToolbar2 is deprecated, especially not the wx non-Agg one. Not having the Toolbar alias in backend_wxagg can break things, though.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having a deprecation for the Toolbar alias would require to replace the assignment
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. derived deprecated class sounds good to me.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. Done, incl. alternatives in deprecation messages. |
||
| class NavigationToolbar2WxAgg(NavigationToolbar2Wx): | ||
| def get_canvas(self, frame, fig): | ||
| return FigureCanvasWxAgg(frame, -1, fig) | ||
|
|
||
|
|
||
| # agg/wxPython image conversion functions (wxPython >= 2.8) | ||
|
|
||
|
|
||
| def _convert_agg_to_wx_image(agg, bbox): | ||
| """ | ||
| Convert the region of the agg buffer bounded by bbox to a wx.Image. If | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,8 +6,8 @@ | |
| import wx | ||
|
|
||
| from .backend_cairo import cairo, FigureCanvasCairo, RendererCairo | ||
| from .backend_wx import ( | ||
| _BackendWx, _FigureCanvasWxBase, FigureFrameWx, NavigationToolbar2Wx) | ||
| from .backend_wx import _BackendWx, _FigureCanvasWxBase, FigureFrameWx | ||
| from .backend_wx import NavigationToolbar2Wx as NavigationToolbar2WxCairo | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can go in the previous line (would prefer this) as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, also for wxagg. |
||
| from . import wx_compat as wxc | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API changes (even for "apparently unused" stuff) should nearly always go through a deprecation period unless it's really too hard to keep around. Just decorate the class with
@deprecated("2.2").There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done