Apply paddings for image description too

This commit is contained in:
Huy Ngo 2024-07-31 16:29:41 +07:00
parent 041cb67746
commit 2989101e67

View file

@ -308,15 +308,15 @@ def print_status(status: Status, width: int = 80, padding: int = 0):
print_html(status.content, width, padding)
if status.media_attachments:
print_out(f"{"" * padding}\n{"" * padding} Media:")
print_out(f"{'' * padding}\n{'' * padding}Media:")
for count, attachment in enumerate(status.media_attachments):
url = attachment.url
description = f'{"" * padding} Description: {attachment.description}'
print_out(f'{"" * padding} {count+1}. <yellow>URL</yellow>: {url}')
for i, line in enumerate(wc_wrap(description, width)):
description = f'Description: {attachment.description}'
print_out(f'{"" * padding}{count+1}. <yellow>URL</yellow>: {url}')
for i, line in enumerate(wc_wrap(description, width - padding)):
if i == 0:
line = line.replace('Description', '<yellow>Description</yellow>')
print_out(line)
print_out('' * padding + line)
if status.poll:
print_poll(status.poll)