Show media in status details

pull/112/head
Ivan Habunek 2019-08-28 17:29:33 +02:00
rodzic 5213eb1835
commit ab1fc6961b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
3 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -3,6 +3,9 @@ Interesting urwid implementations:
* https://github.com/TomasTomecek/sen/blob/master/sen/tui/ui.py
* https://github.com/rndusr/stig/tree/master/stig/tui
Check out:
* https://github.com/rr-/urwid_readline - better edit box?
TODO/Ideas:
* pack left column in timeline view
* allow scrolling of toot contents if they don't fit the screen, perhaps using

Wyświetl plik

@ -19,6 +19,7 @@ PALETTE = [
('link', ',italics', ''),
# Colors
('bold', ',bold', ''),
('blue', 'light blue', ''),
('blue_bold', 'light blue, bold', ''),
('blue_selected', 'white', 'dark blue'),

Wyświetl plik

@ -191,6 +191,15 @@ class StatusDetails(urwid.Pile):
for line in format_content(status.data["content"]):
yield ("pack", urwid.Text(highlight_hashtags(line)))
media = status.data["media_attachments"]
if media:
for m in media:
yield ("pack", urwid.AttrMap(urwid.Divider("-"), "gray"))
yield ("pack", urwid.Text([("bold", "Media attachment"), " (", m["type"], ")"]))
if m["description"]:
yield ("pack", urwid.Text(m["description"]))
yield ("pack", urwid.Text(("link", m["url"])))
poll = status.data.get("poll")
if poll:
yield ("pack", urwid.Divider())