net-misc/toot: fix >=urwid-3.0.4 compatibility

Also:
- disalbe py3.11
- add missing test dependencies

Signed-off-by: David Roman <davidroman96@gmail.com>
This commit is contained in:
David Roman
2026-02-03 12:53:57 +01:00
parent 6ac0b1a92c
commit 1c3ca9bc70
2 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
From 8c2025c054bf71e2dc24d57a9097299310a12ccc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?=
<1289205+lahwaacz@users.noreply.github.com>
Date: Sun, 21 Dec 2025 08:42:37 +0100
Subject: [PATCH] Fix compatibility with urwid 3.0.4
Fixes https://github.com/ihabunek/toot/issues/558
---
toot/tui/images.py | 2 +-
toot/tui/timeline.py | 2 +-
toot/tui/utils.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/toot/tui/images.py b/toot/tui/images.py
index 9dfebec4..7a101f55 100644
--- a/toot/tui/images.py
+++ b/toot/tui/images.py
@@ -94,7 +94,7 @@ def graphics_widget(img, image_format="block", corner_radius=0, colors=16777216)
# "<" means left-justify the image
except ImportError:
- from urwid.raw_display import Screen
+ from urwid.display.raw import Screen
TuiScreen = Screen
def image_support_enabled():
diff --git a/toot/tui/timeline.py b/toot/tui/timeline.py
index 060fdd81..ccdb5513 100644
--- a/toot/tui/timeline.py
+++ b/toot/tui/timeline.py
@@ -20,7 +20,7 @@
logger = logging.getLogger("toot")
-screen = urwid.raw_display.Screen()
+screen = urwid.display.raw.Screen()
class Timeline(urwid.Columns):
diff --git a/toot/tui/utils.py b/toot/tui/utils.py
index c7df968a..b221a17f 100644
--- a/toot/tui/utils.py
+++ b/toot/tui/utils.py
@@ -72,7 +72,7 @@ def parse_content_links(content):
return parser.links[:]
-def copy_to_clipboard(screen: urwid.raw_display.Screen, text: str):
+def copy_to_clipboard(screen: urwid.display.raw.Screen, text: str):
""" copy text to clipboard using OSC 52
This escape sequence is documented
here https://iterm2.com/documentation-escape-codes.html

View File

@@ -0,0 +1,30 @@
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{12..14} )
inherit distutils-r1 pypi
DESCRIPTION="toot - Mastodon CLI & TUI"
HOMEPAGE="https://github.com/ihabunek/toot"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="
dev-python/urwid[${PYTHON_USEDEP}]
dev-python/wcwidth[${PYTHON_USEDEP}]
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
dev-python/tomlkit[${PYTHON_USEDEP}]
test? ( dev-python/psycopg:2[${PYTHON_USEDEP}] )
"
RDEPEND="${DEPEND}"
PATCHES=( "${FILESDIR}/${P}-urwid-compat.patch" )
EPYTEST_PLUGINS=( pytest-click python-dateutil pillow )
distutils_enable_tests pytest