1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-09-22 04:25:55 -04:00

cleanup to make flake8 happy

This commit is contained in:
Daniel Schwarz 2023-12-18 22:30:34 -05:00
parent 1e1b0c49be
commit 481cf89e3a
6 changed files with 4 additions and 10 deletions

View File

@ -1,5 +1,6 @@
import click
import pytest
import sys
from toot.cli.validators import validate_duration
from toot.wcstring import wc_wrap, trunc, pad, fit_text

View File

@ -27,10 +27,9 @@ COLOR_OPTIONS = ", ".join(TUI_COLORS.keys())
@click.option(
"-s", "--cache-size",
callback=validate_cache_size,
help=f"""Specify the image cache maximum size in megabytes. Default: 10MB.
help="""Specify the image cache maximum size in megabytes. Default: 10MB.
Minimum: 1MB."""
)
@pass_context
def tui(
ctx: Context,

View File

@ -85,7 +85,7 @@ def validate_cache_size(ctx: click.Context, param: str, value: Optional[str]) ->
size = int(value)
else:
raise click.BadParameter("Cache size must be numeric.")
if size > 1024:
raise click.BadParameter("Cache size too large: 1024MB maximum.")
elif size < 1:

View File

@ -7,11 +7,9 @@ import webbrowser
from toot import __version__
from toot import api
from toot.utils import format_content
from toot.tui.utils import highlight_hashtags, highlight_keys, add_corners
from toot.tui.utils import highlight_keys, add_corners
from toot.tui.widgets import Button, EditBox, SelectableText, EmojiText
from toot.tui.richtext import html_to_widgets
from toot import api
from PIL import Image
from term_image.image import AutoImage
from term_image.widget import UrwidImage

View File

@ -1,6 +1,5 @@
import logging
import math
import sys
import urwid
import webbrowser
@ -8,7 +7,6 @@ from typing import List, Optional
from toot.tui import app
from toot.utils import format_content
from toot.tui.utils import can_render_pixels, add_corners
from toot.tui.richtext import html_to_widgets, url_to_widget
from toot.utils.datetime import parse_datetime, time_ago

View File

@ -1,7 +1,5 @@
import base64
import re
import shutil
import subprocess
import sys
import urwid
import math