From 4d353cf64a6bb0a5b0684888a8eecb9770530f07 Mon Sep 17 00:00:00 2001 From: "{{ github.actor }}" Date: Thu, 19 Sep 2024 00:38:29 +0000 Subject: [PATCH] Style Reformatting --- screenshot/common/__init__.py | 11 +++++------ screenshot/common/downloader.py | 14 ++++++-------- screenshot/common/filter.py | 4 ++-- screenshot/common/firefox.py | 4 ++-- screenshot/core.py | 14 ++++++-------- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/screenshot/common/__init__.py b/screenshot/common/__init__.py index 2582962..c93602f 100644 --- a/screenshot/common/__init__.py +++ b/screenshot/common/__init__.py @@ -22,23 +22,22 @@ SOFTWARE. """ -import logging import asyncio import contextlib +import logging from contextlib import asynccontextmanager from datetime import datetime, timedelta, timezone from typing import TYPE_CHECKING, AsyncGenerator, Dict, Literal, TypeVar from redbot.core import commands - -from selenium.webdriver.firefox.options import Options -from selenium.webdriver.firefox.service import Service +from selenium.common.exceptions import ScreenshotException, TimeoutException, WebDriverException from selenium.webdriver.common.proxy import Proxy, ProxyType from selenium.webdriver.firefox.firefox_profile import FirefoxProfile -from selenium.common.exceptions import TimeoutException, WebDriverException, ScreenshotException +from selenium.webdriver.firefox.options import Options +from selenium.webdriver.firefox.service import Service -from .firefox import Firefox from .exceptions import ProxyConnectFailedError +from .firefox import Firefox if TYPE_CHECKING: from ..core import Screenshot diff --git a/screenshot/common/downloader.py b/screenshot/common/downloader.py index 883d531..1ce7265 100644 --- a/screenshot/common/downloader.py +++ b/screenshot/common/downloader.py @@ -22,25 +22,23 @@ SOFTWARE. """ -import io -import os import asyncio +import concurrent.futures +import io import logging +import os +import pathlib import platform -import concurrent.futures +import tarfile +import zipfile from typing import ClassVar, Dict, Final, Optional -import pathlib -import zipfile import aiohttp -import tarfile from mozdownload.factory import FactoryScraper - from redbot.core import data_manager from .exceptions import DriverDownloadFailed - log: logging.Logger = logging.getLogger("red.seina.screenshot.downloader") diff --git a/screenshot/common/filter.py b/screenshot/common/filter.py index f6105e9..eb8eb92 100644 --- a/screenshot/common/filter.py +++ b/screenshot/common/filter.py @@ -22,13 +22,13 @@ SOFTWARE. """ -import io import asyncio +import io import logging -from PIL import Image from typing import Any, Dict, Literal, Optional, cast import transformers +from PIL import Image from tensorflow import config as conf try: diff --git a/screenshot/common/firefox.py b/screenshot/common/firefox.py index df89b03..4a73d5d 100644 --- a/screenshot/common/firefox.py +++ b/screenshot/common/firefox.py @@ -26,10 +26,10 @@ import weakref from typing import Any -from selenium.webdriver.common.service import Service from selenium.webdriver.common.options import BaseOptions -from selenium.webdriver.remote.webdriver import WebDriver as _Driver +from selenium.webdriver.common.service import Service from selenium.webdriver.firefox.webdriver import WebDriver as _Firefox +from selenium.webdriver.remote.webdriver import WebDriver as _Driver class Driver(_Driver): diff --git a/screenshot/core.py b/screenshot/core.py index b6f3267..e332cba 100644 --- a/screenshot/core.py +++ b/screenshot/core.py @@ -22,28 +22,26 @@ SOFTWARE. """ +import asyncio.sslproto +import contextlib import io -import aiohttp import logging -import contextlib -import asyncio.sslproto from typing import Dict, Final, List, Literal, Optional, Union +import aiohttp import discord from discord.ext import tasks -from redbot.core.bot import Red from redbot.core import commands +from redbot.core.bot import Red from redbot.core.config import Config from redbot.core.utils.chat_formatting import humanize_list - from selenium.common.exceptions import NoSuchDriverException -from .common.filter import Filter from .common import FirefoxManager from .common.downloader import DriverManager from .common.exceptions import ProxyConnectFailedError -from .common.utils import send_notification, URLConverter - +from .common.filter import Filter +from .common.utils import URLConverter, send_notification log: logging.Logger = logging.getLogger("red.seina.screenshot.core")