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

Widgets rendering now returns __repr__ instead of rendered version in 0.87.1 #5285

Closed
pablogsal opened this issue Nov 25, 2024 · 5 comments
Closed

Comments

@pablogsal
Copy link
Contributor

Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed

Looks like after the 0.87.1 release some widgets are returning the __repr__ instead of the rendered text when the render() method is called. For example:

0.87.1

(Pdb) p widget
Label(id='pid')
(Pdb) p widget.render().__str__()
"RichVisual(Label(id='head_title'), <text 'Memray live tracking' [Span(0, 6, 'bold')] ''>)"

before:

(Pdb) p widget
Label(id='head_title')
(Pdb) p widget.render().__str__()
'Memray live tracking'

I couldn't find this change in the changeling here

Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@pablogsal
Copy link
Contributor Author

If this is expected, what would be the way to get the rendered version after 0.87.1?

@willmcgugan
Copy link
Collaborator

That is expected from anything that extends Static, which includes Label. You could use the renderable attribute, which will return the original value before it was wrapped in RichVisual.

@pablogsal
Copy link
Contributor Author

Great, that works! Thanks a lot @willmcgugan ❤️

@pablogsal pablogsal closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

No branches or pull requests

2 participants