20
20
from .overlays import StatusDeleteConfirmation , Account
21
21
from .poll import Poll
22
22
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
24
24
from PIL import Image
25
25
26
26
@@ -36,6 +36,7 @@ class TuiOptions(NamedTuple):
36
36
colors : int
37
37
media_viewer : Optional [str ]
38
38
relative_datetimes : bool
39
+ cache_size : int
39
40
40
41
41
42
class Header (urwid .WidgetWrap ):
@@ -95,7 +96,7 @@ class TUI(urwid.Frame):
95
96
@staticmethod
96
97
def create (app : App , user : User , args : TuiOptions ):
97
98
"""Factory method, sets up TUI and an event loop."""
98
- screen = urwid . raw_display . Screen ()
99
+ screen = TuiScreen ()
99
100
screen .set_terminal_properties (args .colors )
100
101
101
102
tui = TUI (app , user , screen , args )
@@ -143,8 +144,8 @@ def __init__(self, app, user, screen, options: TuiOptions):
143
144
self .account = None
144
145
self .followed_accounts = []
145
146
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
148
149
else :
149
150
self .cache_max = 1024 * 1024 * 10 # default 10MB
150
151
0 commit comments