Run some lint

This commit is contained in:
Huy Ngo 2024-08-09 18:34:43 +07:00
parent 23d49c8e57
commit 5273d32c30
3 changed files with 7 additions and 7 deletions

View file

@ -1,4 +1,3 @@
[flake8]
exclude=build,tests,tmp,venv,toot/tui/scroll.py
ignore=E128,W503,W504
exclude=build,tests,tmp,venv,witchie/tui
max-line-length=120

View file

@ -26,6 +26,7 @@ witchie includes a terminal user interface (TUI). Run it with `witchie tui`.
![compose post in TUI](https://raw.githubusercontent.com/ihabunek/toot/master/docs/images/tui_compose.png)
For now, the TUI is not maintained.
## License

View file

@ -320,7 +320,7 @@ def print_status(status: Status, width: int = TERM_WIDTH, padding: int = 0):
for count, attachment in enumerate(status.media_attachments):
url = attachment.url
description = f'Description: {attachment.description}'
print_out(f'{paddings}{count+1}. <yellow>URL</yellow>: {url}')
print_out(f'{paddings}{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>')
@ -336,7 +336,7 @@ def print_status(status: Status, width: int = TERM_WIDTH, padding: int = 0):
print_out(paddings)
reacts = ('\n' + paddings).join([f'{react.count} × {react.name}'
for react in status.emoji_reactions])
for react in status.emoji_reactions])
if reacts:
reacts = paddings + reacts
@ -363,7 +363,7 @@ def print_poll(poll: Poll):
print_out()
for idx, option in enumerate(poll.options):
perc = (round(100 * option.votes_count / poll.votes_count)
if poll.votes_count and option.votes_count is not None else 0)
if poll.votes_count and option.votes_count is not None else 0)
if poll.voted and poll.own_votes and idx in poll.own_votes:
voted_for = " <yellow>✓</yellow>"
@ -407,10 +407,10 @@ def print_tree(tree, depth=0):
paddings = "" * (depth - 1) + ""
else:
paddings = ""
print_status(tree['status'], TERM_WIDTH-depth, padding=depth)
print_status(tree['status'], TERM_WIDTH - depth, padding=depth)
print_out(paddings + "" * (TERM_WIDTH - depth))
for reply in tree['replies']:
print_tree(reply, depth+1)
print_tree(reply, depth + 1)
notification_msgs = {