1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-23 06:25:26 +00:00

Fix alignment in timeline

This commit is contained in:
Ivan Habunek 2018-06-12 10:52:47 +02:00
parent e1cfda1acb
commit 3f79b76aab
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -9,7 +9,7 @@ from itertools import chain
from itertools import zip_longest
from textwrap import wrap, TextWrapper
from toot.utils import format_content, get_text
from toot.utils import format_content, get_text, trunc
START_CODES = {
'red': '\033[31m',
@ -138,7 +138,7 @@ def print_timeline(items):
return zip_longest(left_column, right_column, fillvalue="")
for left, right in timeline_rows(item):
print_out("{:30}{}".format(left, right))
print_out("{:30}{}".format(trunc(left, 30), right))
def _parse_item(item):
content = item['reblog']['content'] if item['reblog'] else item['content']