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

Support easier widget "support classes" importing #1637

Merged
merged 6 commits into from
Jan 25, 2023

Conversation

davep
Copy link
Contributor

@davep davep commented Jan 23, 2023

This PR implements the suggested solution for the requirement detailed in #1589. Quite simply, for those widgets that have non-widget support classes that the using-developer needs access to, have a parallel non-under-prefixed version of the code that imports and "reexports" the support classes.

As such, all this PR does is implement this approach for the widgets that seen to need it. The only one that required it at the moment was DataTable, so that Column and Row can be seen by the calling code. TreeNode already had an approach to this but for the sake of completeness I've added parallel support for this newer convention.

We may want to think about deprecating widgets.TreeNode.

@davep davep added the enhancement New feature or request label Jan 23, 2023
@davep davep self-assigned this Jan 23, 2023
@davep davep linked an issue Jan 23, 2023 that may be closed by this pull request
Copy link
Collaborator

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

Could you remove references to TreeNode from the lazy-loading "widgets" while you are here.

@davep
Copy link
Contributor Author

davep commented Jan 23, 2023

Could you remove references to TreeNode from the lazy-loading "widgets" while you are here.

Yup, happy to. Was holding that for a followup PR but if we're happy for the breaking change now that's my preference too. :-)

davep added 4 commits January 23, 2023 17:37
This encourages importing it from `textual.widgets.tree` instead, keeping it
in line with the other changes made for Textualize#1637.

Note this is a breaking change.
This aims to make it clear that a small but significant breaking change has
taken place. See Textualize#1637.
@davep
Copy link
Contributor Author

davep commented Jan 23, 2023

TreeNode now modified to follow this PR: 4adfe69

@willmcgugan willmcgugan merged commit a61e61f into Textualize:main Jan 25, 2023
@davep davep deleted the widget-importing branch January 25, 2023 10:55
oleksis added a commit to oleksis/jtree that referenced this pull request Aug 24, 2023
…ets; it is now available via from textual.widgets.tree import TreeNode. Textualize/textual#1637
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor widgets imports to allow importing of related objects
3 participants