1
0
mirror of https://github.com/ihabunek/toot synced 2025-02-08 08:08:40 +01:00

Handle urwid API deprecations

* `_set_original_widget` -> `original_widget` property (setter)
* `button._state` -> `button.get_state()`
  (not deprecated, but we have public getter)
This commit is contained in:
Aleksei Stepanov 2025-01-01 14:09:06 +01:00 committed by Ivan Habunek
parent 1368a89125
commit d4a991e956
2 changed files with 4 additions and 4 deletions

View File

@ -338,9 +338,9 @@ class Timeline(urwid.Columns):
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.

View File

@ -58,7 +58,7 @@ class CheckBox(urwid.AttrWrap):
def get_state(self):
"""Return the state of the checkbox."""
return self.button._state
return self.button.get_state()
class RadioButton(urwid.AttrWrap):