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

Disallow Screen instances in App.SCREENS #4894

Merged
merged 21 commits into from
Aug 22, 2024

Conversation

ZeroIntensity
Copy link
Contributor

cc @willmcgugan
Closes #4893.

It's worth noting that while implementing this, I discovered a second issue: add_mode appends to the MODES classvar, meaning it applies to all instances of the App -- if this is the desired behavior, then it should probably be made a classmethod. Otherwise, maybe an attribute to hold per-instance modes?

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.

Added some requests. I think the documentation may need an update. There are a few examples which use the old Screen instances in the classvar. There may also be some copy change required...

src/textual/app.py Outdated Show resolved Hide resolved
src/textual/app.py Outdated Show resolved Hide resolved
src/textual/app.py Outdated Show resolved Hide resolved
@ZeroIntensity
Copy link
Contributor Author

Should be all done now, thanks!

@ZeroIntensity
Copy link
Contributor Author

I think all the places where an instance was used in MODES or SCREENS in the docs have been fixed.

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.

Couple of requests then we should be good to go...

src/textual/app.py Outdated Show resolved Hide resolved
src/textual/app.py Outdated Show resolved Hide resolved
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.

LGTM Thanks!

@ZeroIntensity
Copy link
Contributor Author

Sorry; I'll fix the merge conflicts sometime later today.

@ZeroIntensity
Copy link
Contributor Author

Merge conflicts have been fixed!

@willmcgugan willmcgugan merged commit 5573697 into Textualize:main Aug 22, 2024
20 checks passed
@willmcgugan
Copy link
Collaborator

Are you really 16?!

I figured you were already a pro.

@ZeroIntensity
Copy link
Contributor Author

Yup! I've been doing this since I was ~9.

@ZeroIntensity ZeroIntensity deleted the disallow-screen-instances branch August 22, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't allow screen instances in App.SCREENS
2 participants