Update _*_changed static trait listeners to use traits observe#954
Merged
Conversation
aaronayres35
commented
Jun 17, 2021
Comment on lines
2009
to
+2013
| # Handles the 'feature_changed' trait being changed: | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| def _feature_changed(self): | ||
| @observe("feature_changed") | ||
| def _feature_changed_updated(self, event): |
Contributor
Author
There was a problem hiding this comment.
I believe this had been a bug before I will look into writing a regression test
aaronayres35
commented
Jun 18, 2021
|
|
||
| class TestDockControl(unittest.TestCase): | ||
|
|
||
| @unittest.skipIf(not_wx, "This test is specific to the wx backend") |
Contributor
Author
There was a problem hiding this comment.
To my surprise, pyface/dock/dock_sizer.py is wx specific although it lives in a generic module.
pyface/pyface/dock/dock_sizer.py
Line 20 in 1a416ee
Contributor
|
@aaronayres35 looks like the |
Contributor
Author
Agh, my mistake. I pulled the problem import inside the test - hopefully that should fix things |
rahulporuri
approved these changes
Jun 21, 2021
| # Handles the 'feature_changed' trait being changed: | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| def _feature_changed(self): |
Contributor
There was a problem hiding this comment.
ahh looks like this was buggy before - feature_changed is the event trait
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.
Part of #899
This PR replaces some of the instances of
_*_changedstatic trait listeners withobservefrom the code base. There are still plenty more that will need to be addressed in follow up PRs.