Skip to content
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

Dynamic otc to observe 2 #1525

Merged
merged 6 commits into from
Feb 24, 2021
Merged

Dynamic otc to observe 2 #1525

merged 6 commits into from
Feb 24, 2021

Conversation

aaronayres35
Copy link
Contributor

contributes to #1052

This PR updates a few files to use dynamic observe instead of on_trait_change. More similar PRs to follow

@aaronayres35
Copy link
Contributor Author

Ah I realize my hacky fix was dumb...

@rahulporuri rahulporuri added this to In progress in Enthought OSS Q1 2021 Feb 24, 2021
Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple of comments.

@@ -201,7 +201,7 @@ def init(self, ui, parent, style):
self.control.accept,
default=default,
)
ui.on_trait_change(self._on_error, "errors", dispatch="ui")
ui.observe(self._on_error, "errors", dispatch="ui")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't seem to be unhooking this listener.

@@ -155,7 +155,7 @@ def init(self, ui, parent, style):
self.control.accept,
default=default,
)
ui.on_trait_change(self._on_error, "errors", dispatch="ui")
ui.observe(self._on_error, "errors", dispatch="ui")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we have two listeners that don't get unhooked in this module. Instead of going over your PRs again and creating an issue pointing out unhooked listeners like we did in Pyface, let's create an issue in traitsui now - which we can continually update?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened #1526

@aaronayres35 aaronayres35 merged commit d7315b4 into master Feb 24, 2021
Enthought OSS Q1 2021 automation moved this from In progress to Done Feb 24, 2021
@aaronayres35 aaronayres35 deleted the dynamic-otc-to-observe2 branch February 24, 2021 12:53
@rahulporuri rahulporuri moved this from Done to Sprint 3 : Feb 8 2021 - Feb 26 2021 in Enthought OSS Q1 2021 Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Enthought OSS Q1 2021
Sprint 3 : Feb 8 2021 - Feb 26 2021
Development

Successfully merging this pull request may close these issues.

None yet

2 participants