Simplify handling of Qt modifier keys.#14507
Merged
Merged
Conversation
Contributor
Author
|
rebased |
timhoffm
reviewed
May 22, 2020
Member
timhoffm
left a comment
There was a problem hiding this comment.
No deprecation, as these can't be properly deprecated anyways.
You can deprecate anything. It's just a matter of writing an entry into the deprecations list. What you cannot do here is warn the user when he uses the deprecated variables (well at least not before 3.7).
I may be overly catious but this seems like some people will have used it. So I'm in favor of a proper depreaction.
- Add a deprecation note. We're at least formally safe. People could have read the deprecation notes before switching to a new version.
- For Py3.7+ use module-level getattr to warn.
|
|
||
| The ``MODIFIER_KEYS``, ``SUPER``, ``ALT``, ``CTRL``, and ``SHIFT`` global | ||
| variables of the :mod:`matplotlib.backends.backend_qt4` and | ||
| :mod:`matplotlib.backends.backend_qt5` modules have been removed. |
Member
There was a problem hiding this comment.
"Use the native Qt modifiers instead."
Contributor
Author
|
Restored with deprecation notice. Let's leave module-level getattr until we set up some generic helpers for them (I had a PR somewhere demo'ing how to do that...). |
b850318 to
c935bb7
Compare
Member
|
Doc build failures: |
timhoffm
approved these changes
Jun 8, 2020
- Replace MODIFIER_KEYS by a simpler private table that doesn't include
the names used by Matplotlib ("super"/"alt"/...), instead just get
these names from SPECIAL_KEYS (this avoids having to also update
_MODIFIER_KEYS for osx, where we use different names).
- Deprecate the globals SUPER, ALT, CTLR, SHIFT which were just indices
into MODIFIER_KEYS but otherwise meaningless.
- Invert the order of _MODIFIERS_KEYS to avoid having to do a
`reverse()` later in the code.
- Get max_unicode value from Python's sys module.
QuLogic
reviewed
Jun 8, 2020
QuLogic
approved these changes
Jun 9, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
the names used by Matplotlib ("super"/"alt"/...), instead just get
these names from SPECIAL_KEYS (this avoids having to also update
_MODIFIER_KEYS for osx, where we use different names).
into MODIFIER_KEYS but otherwise meaningless.
reverse()later in the code.No deprecation, as these can't be properly deprecated anyways.
Goes on top of #14506.
PR Checklist