Skip to content

Commit

Permalink
Handle urwid API deprecations
Browse files Browse the repository at this point in the history
* `_set_original_widget` -> `original_widget` property (setter)
* `button._state` -> `button.get_state()`
  (not deprecated, but we have public getter)
  • Loading branch information
penguinolog committed Jan 1, 2025
1 parent 1368a89 commit 23d739e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions toot/tui/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ def update_status_image(self, status, path, placeholder_index):
pass
if img:
try:
status.placeholders[placeholder_index]._set_original_widget(
graphics_widget(img, image_format=self.tui.options.image_format, corner_radius=10,
colors=self.tui.options.colors))
status.placeholders[placeholder_index].original_widget = graphics_widget(
img, image_format=self.tui.options.image_format, corner_radius=10, colors=self.tui.options.colors
)

except IndexError:
# ignore IndexErrors.
Expand Down
2 changes: 1 addition & 1 deletion toot/tui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, *args, **kwargs):

def get_state(self):
"""Return the state of the checkbox."""
return self.button._state
return self.button.get_state()


class RadioButton(urwid.AttrWrap):
Expand Down

0 comments on commit 23d739e

Please sign in to comment.