-
Notifications
You must be signed in to change notification settings - Fork 311
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
make ScrollBar check wrapped widgets for SupportsScroll (Fixes #878) #879
Conversation
Pull Request Test Coverage Report for Build 9075496246Details
💛 - Coveralls |
penguinolog: `w.original_widget` can point to `w`, we need to filter such behaviour to prevent infinite loop
if w in visited: | ||
break | ||
visited.add(w) | ||
yield w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://urwid.org/reference/widget.html#urwid.WidgetDecoration.base_widget exists to get the "most" .original_widget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are there decorations that are scrollable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://urwid.org/reference/widget.html#urwid.WidgetDecoration.base_widget exists to get the "most"
.original_widget
Looking at the code, it is implemented like this generator was originally, i.e., vulnerable to infinite loops. So the fix in e5377cf should be applied also in widget_decoration.py
, at least.
I have no idea if there are scrollable decorations; this is my first time working with the urwid code. It seems like a silly thing to implement, but if someone did they might be hit with an extremely confusing bug if we only check the base_widget
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are there decorations that are scrollable?
Scrollable
is a decoration adding scroll support to the widgets:
urwid/urwid/widget/scrollable.py
Line 140 in ba5c1c0
class Scrollable(WidgetDecoration[WrappedWidget]): |
Fix static checker warning
Checklist
master
orpython-dual-support
branchtox
successfully in local environmentDescription:
Fixes #878 .