Fix padding

This commit is contained in:
Huy Ngo 2024-08-05 11:39:39 +07:00
parent cfc9d7b0c9
commit 34c65f838a

View file

@ -304,7 +304,7 @@ def print_status(status: Status, width: int = 80, padding: int = 0):
f"<yellow>{time}</yellow>",
)
print_out("" * padding)
print_out(paddings)
if status.spoiler_text:
print_out(paddings + "<yellow>Subject</yellow>: ", end="")
print_html(status.spoiler_text)
@ -398,13 +398,13 @@ def print_timeline(items: Iterable[Status], width=80, padding=0):
def print_tree(tree, depth=0):
"""Print a thread tree"""
if depth >= 20:
print_out(" " * 20 + "(Thread goes too deep)")
print_out("" * 20 + "(Thread goes too deep)")
if depth:
paddings = "" * (depth - 1) + ""
else:
paddings = ""
print_status(tree['status'], 80-depth, padding=depth)
print_out(paddings + "" * 80)
print_out(paddings + "" * (80 - depth))
for reply in tree['replies']:
print_tree(reply, depth+1)