From 57cfd41613822bfa54a2e83639096795c0ed28ca Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Thu, 16 Nov 2023 11:49:48 +0100 Subject: [PATCH] Remove old stubs --- .flake8 | 1 - toot/tui/stubs/stub_hyperlink.py | 25 ------------------------- toot/tui/stubs/stub_text_embed.py | 21 --------------------- toot/tui/stubs/urwidgets.py | 8 -------- toot/tui/urwidgets.py | 8 -------- 5 files changed, 63 deletions(-) delete mode 100644 toot/tui/stubs/stub_hyperlink.py delete mode 100644 toot/tui/stubs/stub_text_embed.py delete mode 100644 toot/tui/stubs/urwidgets.py delete mode 100644 toot/tui/urwidgets.py diff --git a/.flake8 b/.flake8 index cc916ad..6efbecd 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,4 @@ [flake8] exclude=build,tests,tmp,venv,toot/tui/scroll.py ignore=E128,W503 -per-file-ignores=toot/tui/stubs/urwidgets.py:F401 max-line-length=120 diff --git a/toot/tui/stubs/stub_hyperlink.py b/toot/tui/stubs/stub_hyperlink.py deleted file mode 100644 index aa0488d..0000000 --- a/toot/tui/stubs/stub_hyperlink.py +++ /dev/null @@ -1,25 +0,0 @@ -__all__ = ("Hyperlink",) - -import urwid - - -class Hyperlink(urwid.WidgetWrap): - def __init__(self, uri, attr, text): - pass - - def render(self, size, focus): - return None - - -class HyperlinkCanvas(urwid.Canvas): - def __init__(self, uri: str, text_canv: urwid.TextCanvas): - pass - - def cols(self): - return 0 - - def content(self, *args, **kwargs): - yield [None] - - def rows(self): - return 0 diff --git a/toot/tui/stubs/stub_text_embed.py b/toot/tui/stubs/stub_text_embed.py deleted file mode 100644 index 622b5f7..0000000 --- a/toot/tui/stubs/stub_text_embed.py +++ /dev/null @@ -1,21 +0,0 @@ -__all__ = ("parse_text", "TextEmbed") - -import urwid - - -class TextEmbed(urwid.Text): - def get_text(self): - return None - - def render(self, size, focus): - return None - - def set_text(self, markup): - pass - - def set_wrap_mode(self, mode): - pass - - -def parse_text(text, patterns, repl, *repl_args, **repl_kwargs): - return None diff --git a/toot/tui/stubs/urwidgets.py b/toot/tui/stubs/urwidgets.py deleted file mode 100644 index 92737d3..0000000 --- a/toot/tui/stubs/urwidgets.py +++ /dev/null @@ -1,8 +0,0 @@ -# If urwidgets is loaded use it; otherwise use our stubs -try: - from urwidgets import Hyperlink, TextEmbed, parse_text - has_urwidgets = True -except ImportError: - from .stub_hyperlink import Hyperlink - from .stub_text_embed import TextEmbed, parse_text - has_urwidgets = False diff --git a/toot/tui/urwidgets.py b/toot/tui/urwidgets.py deleted file mode 100644 index ee731a8..0000000 --- a/toot/tui/urwidgets.py +++ /dev/null @@ -1,8 +0,0 @@ -# If urwidgets is loaded use it; otherwise use our stubs -try: - from urwidgets import Hyperlink, TextEmbed, parse_text # noqa: F401 - has_urwidgets = True -except ImportError: - from .stub_hyperlink import Hyperlink # noqa: F401 - from .stub_text_embed import TextEmbed, parse_text # noqa: F401 - has_urwidgets = False