Skip to content

Commit

Permalink
Updated image support for compatiblity with 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danschwarz committed Dec 19, 2023
1 parent f92ce4d commit 1e1b0c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions toot/tui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .overlays import StatusDeleteConfirmation, Account
from .poll import Poll
from .timeline import Timeline
from .utils import get_max_toot_chars, parse_content_links, show_media, copy_to_clipboard, ImageCache
from .utils import get_max_toot_chars, parse_content_links, copy_to_clipboard, ImageCache
from PIL import Image


Expand All @@ -36,6 +36,7 @@ class TuiOptions(NamedTuple):
colors: int
media_viewer: Optional[str]
relative_datetimes: bool
cache_size: int


class Header(urwid.WidgetWrap):
Expand Down Expand Up @@ -95,7 +96,7 @@ class TUI(urwid.Frame):
@staticmethod
def create(app: App, user: User, args: TuiOptions):
"""Factory method, sets up TUI and an event loop."""
screen = urwid.raw_display.Screen()
screen = TuiScreen()
screen.set_terminal_properties(args.colors)

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

if self.args.cache_size:
self.cache_max = 1024 * 1024 * self.args.cache_size
if self.options.cache_size:
self.cache_max = 1024 * 1024 * self.options.cache_size
else:
self.cache_max = 1024 * 1024 * 10 # default 10MB

Expand Down

0 comments on commit 1e1b0c4

Please sign in to comment.