Compatibility with urwid 5.0

- Scrollable: use Pile.focus instead of Pile.get_focus(), which urwid 5.0 removes.
- ImageScreen: subclass urwid.display.raw.Screen instead of the urwid.raw_display
  path, deprecated since urwid 2.4.0 and to be removed in urwid 7.0.

Both replacements work with urwid 3.0.5, the declared minimum.
This commit is contained in:
Aleksei Stepanov 2026-10-14 10:40:31 +02:00
parent b2f852c9e0
commit 17ffafc757
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ from ._termlib import is_kitty_supported
from .widget import ImageWidget
# A raw display screen subclass with Kitty TGP side-channel support
class ImageScreen(urwid.raw_display.Screen):
class ImageScreen(urwid.display.raw.Screen):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._ti_images = {}

View file

@ -146,7 +146,7 @@ class Scrollable(urwid.WidgetDecoration):
ow.focus = pwi
st = None
nf = ow.get_focus()
nf = ow.focus
if hasattr(nf, "key_timeout"):
st = nf
elif hasattr(nf, "original_widget"):