Skip to content

Commit 1e1b0c4

Browse files
committed
Updated image support for compatiblity with 0.4.0
1 parent f92ce4d commit 1e1b0c4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

toot/tui/app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from .overlays import StatusDeleteConfirmation, Account
2121
from .poll import Poll
2222
from .timeline import Timeline
23-
from .utils import get_max_toot_chars, parse_content_links, show_media, copy_to_clipboard, ImageCache
23+
from .utils import get_max_toot_chars, parse_content_links, copy_to_clipboard, ImageCache
2424
from PIL import Image
2525

2626

@@ -36,6 +36,7 @@ class TuiOptions(NamedTuple):
3636
colors: int
3737
media_viewer: Optional[str]
3838
relative_datetimes: bool
39+
cache_size: int
3940

4041

4142
class Header(urwid.WidgetWrap):
@@ -95,7 +96,7 @@ class TUI(urwid.Frame):
9596
@staticmethod
9697
def create(app: App, user: User, args: TuiOptions):
9798
"""Factory method, sets up TUI and an event loop."""
98-
screen = urwid.raw_display.Screen()
99+
screen = TuiScreen()
99100
screen.set_terminal_properties(args.colors)
100101

101102
tui = TUI(app, user, screen, args)
@@ -143,8 +144,8 @@ def __init__(self, app, user, screen, options: TuiOptions):
143144
self.account = None
144145
self.followed_accounts = []
145146

146-
if self.args.cache_size:
147-
self.cache_max = 1024 * 1024 * self.args.cache_size
147+
if self.options.cache_size:
148+
self.cache_max = 1024 * 1024 * self.options.cache_size
148149
else:
149150
self.cache_max = 1024 * 1024 * 10 # default 10MB
150151

0 commit comments

Comments
 (0)