From ffa180e8a6fc31594f40cda033e892a676c127c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 11:38:58 +0000 Subject: [PATCH] :lipstick: auto fix by pre-commit hooks --- nonebot_bison/config/db_config.py | 3 +-- nonebot_bison/config/subs_io/utils.py | 6 ++---- nonebot_bison/platform/platform.py | 27 +++++++++------------------ 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/nonebot_bison/config/db_config.py b/nonebot_bison/config/db_config.py index 5140775..f72a572 100644 --- a/nonebot_bison/config/db_config.py +++ b/nonebot_bison/config/db_config.py @@ -22,8 +22,7 @@ def _get_time(): return cur_time -class SubscribeDupException(Exception): - ... +class SubscribeDupException(Exception): ... class DBConfig: diff --git a/nonebot_bison/config/subs_io/utils.py b/nonebot_bison/config/subs_io/utils.py index 06f8df6..181769a 100644 --- a/nonebot_bison/config/subs_io/utils.py +++ b/nonebot_bison/config/subs_io/utils.py @@ -1,6 +1,4 @@ -class NBESFVerMatchErr(Exception): - ... +class NBESFVerMatchErr(Exception): ... -class NBESFParseErr(Exception): - ... +class NBESFParseErr(Exception): ... diff --git a/nonebot_bison/platform/platform.py b/nonebot_bison/platform/platform.py index 5b98968..f6232ed 100644 --- a/nonebot_bison/platform/platform.py +++ b/nonebot_bison/platform/platform.py @@ -77,8 +77,7 @@ class PlatformMeta(RegistryMeta): super().__init__(name, bases, namespace, **kwargs) -class PlatformABCMeta(PlatformMeta, ABC): - ... +class PlatformABCMeta(PlatformMeta, ABC): ... class Platform(metaclass=PlatformABCMeta, base=True): @@ -99,26 +98,22 @@ class Platform(metaclass=PlatformABCMeta, base=True): @classmethod @abstractmethod - async def get_target_name(cls, client: AsyncClient, target: Target) -> str | None: - ... + async def get_target_name(cls, client: AsyncClient, target: Target) -> str | None: ... @abstractmethod - async def fetch_new_post(self, sub_unit: SubUnit) -> list[tuple[PlatformTarget, list[Post]]]: - ... + async def fetch_new_post(self, sub_unit: SubUnit) -> list[tuple[PlatformTarget, list[Post]]]: ... async def do_fetch_new_post(self, sub_unit: SubUnit) -> list[tuple[PlatformTarget, list[Post]]]: return await catch_network_error(self.fetch_new_post, sub_unit) or [] @abstractmethod - async def batch_fetch_new_post(self, sub_units: list[SubUnit]) -> list[tuple[PlatformTarget, list[Post]]]: - ... + async def batch_fetch_new_post(self, sub_units: list[SubUnit]) -> list[tuple[PlatformTarget, list[Post]]]: ... async def do_batch_fetch_new_post(self, sub_units: list[SubUnit]) -> list[tuple[PlatformTarget, list[Post]]]: return await catch_network_error(self.batch_fetch_new_post, sub_units) or [] @abstractmethod - async def parse(self, raw_post: RawPost) -> Post: - ... + async def parse(self, raw_post: RawPost) -> Post: ... async def do_parse(self, raw_post: RawPost) -> Post: "actually function called" @@ -360,20 +355,16 @@ class StatusChange(Platform, abstract=True): pass @abstractmethod - async def get_status(self, target: Target) -> Any: - ... + async def get_status(self, target: Target) -> Any: ... @abstractmethod - async def batch_get_status(self, targets: list[Target]) -> list[Any]: - ... + async def batch_get_status(self, targets: list[Target]) -> list[Any]: ... @abstractmethod - def compare_status(self, target: Target, old_status, new_status) -> list[RawPost]: - ... + def compare_status(self, target: Target, old_status, new_status) -> list[RawPost]: ... @abstractmethod - async def parse(self, raw_post: RawPost) -> Post: - ... + async def parse(self, raw_post: RawPost) -> Post: ... async def _handle_status_change( self, new_status: Any, sub_unit: SubUnit