From 53b8a5397b9d3ef6b403b383e06cf4b194cc4750 Mon Sep 17 00:00:00 2001 From: ManyManyTomato <93612024+ATTomatoo@users.noreply.github.com> Date: Sat, 5 Jul 2025 08:32:08 +0000 Subject: [PATCH] =?UTF-8?q?Ruff=20=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py | 2 +- zhenxun/builtin_plugins/nickname.py | 2 +- zhenxun/builtin_plugins/platform/qq_api/ug_watch.py | 2 +- zhenxun/builtin_plugins/scheduler_admin/__init__.py | 2 +- zhenxun/builtin_plugins/scheduler_admin/command.py | 2 +- zhenxun/models/bot_console.py | 2 +- zhenxun/models/plugin_info.py | 2 +- zhenxun/models/schedule_info.py | 2 +- zhenxun/services/db_context.py | 2 +- zhenxun/utils/browser.py | 2 +- zhenxun/utils/decorator/retry.py | 2 +- zhenxun/utils/enum.py | 2 +- zhenxun/utils/exception.py | 2 +- zhenxun/utils/http_utils.py | 2 +- zhenxun/utils/manager/schedule_manager.py | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py b/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py index 6c76f2a7..05213aa3 100644 --- a/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py +++ b/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py @@ -251,7 +251,7 @@ class PluginManage: ) group.status = False await group.save(update_fields=["status"]) - + @classmethod async def wake(cls, group_id: str): """醒来 diff --git a/zhenxun/builtin_plugins/nickname.py b/zhenxun/builtin_plugins/nickname.py index 4d69abcf..5cbc519e 100644 --- a/zhenxun/builtin_plugins/nickname.py +++ b/zhenxun/builtin_plugins/nickname.py @@ -280,4 +280,4 @@ async def _(bot: Bot, session: Uninfo): else: await MessageUtils.build_message("你在做梦吗?你没有昵称啊").finish( reply_to=True - ) \ No newline at end of file + ) diff --git a/zhenxun/builtin_plugins/platform/qq_api/ug_watch.py b/zhenxun/builtin_plugins/platform/qq_api/ug_watch.py index 800a2363..4435e880 100644 --- a/zhenxun/builtin_plugins/platform/qq_api/ug_watch.py +++ b/zhenxun/builtin_plugins/platform/qq_api/ug_watch.py @@ -31,4 +31,4 @@ async def _(session: Uninfo): await FriendUser.create( user_id=session.user.id, platform=PlatformUtils.get_platform(session) ) - logger.info("添加当前好友用户信息", "", session=session) \ No newline at end of file + logger.info("添加当前好友用户信息", "", session=session) diff --git a/zhenxun/builtin_plugins/scheduler_admin/__init__.py b/zhenxun/builtin_plugins/scheduler_admin/__init__.py index a2865979..adaaa621 100644 --- a/zhenxun/builtin_plugins/scheduler_admin/__init__.py +++ b/zhenxun/builtin_plugins/scheduler_admin/__init__.py @@ -48,4 +48,4 @@ __plugin_meta__ = PluginMetadata( plugin_type=PluginType.SUPERUSER, is_show=False, ).to_dict(), -) \ No newline at end of file +) diff --git a/zhenxun/builtin_plugins/scheduler_admin/command.py b/zhenxun/builtin_plugins/scheduler_admin/command.py index 0238d9c8..08a085fb 100644 --- a/zhenxun/builtin_plugins/scheduler_admin/command.py +++ b/zhenxun/builtin_plugins/scheduler_admin/command.py @@ -833,4 +833,4 @@ async def _(schedule_id: int): f"▫️ 触发规则: {_format_trigger(status)}", f"▫️ 任务参数: {_format_params(status)}", ] - await schedule_cmd.finish("\n".join(info_lines)) \ No newline at end of file + await schedule_cmd.finish("\n".join(info_lines)) diff --git a/zhenxun/models/bot_console.py b/zhenxun/models/bot_console.py index cf1faaf2..500593fa 100644 --- a/zhenxun/models/bot_console.py +++ b/zhenxun/models/bot_console.py @@ -29,7 +29,7 @@ class BotConsole(Model): class Meta: # pyright: ignore [reportIncompatibleVariableOverride] table = "bot_console" table_description = "Bot数据表" - + cache_type = CacheType.BOT @staticmethod diff --git a/zhenxun/models/plugin_info.py b/zhenxun/models/plugin_info.py index 793b31d5..aeecc71b 100644 --- a/zhenxun/models/plugin_info.py +++ b/zhenxun/models/plugin_info.py @@ -58,7 +58,7 @@ class PluginInfo(Model): class Meta: # pyright: ignore [reportIncompatibleVariableOverride] table = "plugin_info" table_description = "插件基本信息" - + cache_type = CacheType.PLUGINS @classmethod diff --git a/zhenxun/models/schedule_info.py b/zhenxun/models/schedule_info.py index 4b994756..c7583078 100644 --- a/zhenxun/models/schedule_info.py +++ b/zhenxun/models/schedule_info.py @@ -35,4 +35,4 @@ class ScheduleInfo(Model): class Meta: # pyright: ignore [reportIncompatibleVariableOverride] table = "schedule_info" - table_description = "通用定时任务表" \ No newline at end of file + table_description = "通用定时任务表" diff --git a/zhenxun/services/db_context.py b/zhenxun/services/db_context.py index 8cc66d95..360c0fa8 100644 --- a/zhenxun/services/db_context.py +++ b/zhenxun/services/db_context.py @@ -42,7 +42,7 @@ class Model(TortoiseModel): Model_: Model """ sem_data: ClassVar[dict[str, dict[str, Semaphore]]] = {} - + def __init_subclass__(cls, **kwargs): if cls.__module__ not in MODELS: MODELS.append(cls.__module__) diff --git a/zhenxun/utils/browser.py b/zhenxun/utils/browser.py index 5644bf88..310ed606 100644 --- a/zhenxun/utils/browser.py +++ b/zhenxun/utils/browser.py @@ -91,4 +91,4 @@ class AsyncPlaywright: if card: await card.screenshot(path=path, timeout=timeout, type=type_) return MessageUtils.build_message(path) - return None \ No newline at end of file + return None diff --git a/zhenxun/utils/decorator/retry.py b/zhenxun/utils/decorator/retry.py index 892005bc..e81aa334 100644 --- a/zhenxun/utils/decorator/retry.py +++ b/zhenxun/utils/decorator/retry.py @@ -223,4 +223,4 @@ class Retry: return sync_wrapper - return decorator \ No newline at end of file + return decorator diff --git a/zhenxun/utils/enum.py b/zhenxun/utils/enum.py index 23b5a946..7baf8d37 100644 --- a/zhenxun/utils/enum.py +++ b/zhenxun/utils/enum.py @@ -50,7 +50,7 @@ class CacheType(StrEnum): """用户权限""" LIMIT = "GLOBAL_LIMIT" """插件限制""" - + class BankHandleType(StrEnum): DEPOSIT = "DEPOSIT" """存款""" diff --git a/zhenxun/utils/exception.py b/zhenxun/utils/exception.py index eb62f72d..9ab664f4 100644 --- a/zhenxun/utils/exception.py +++ b/zhenxun/utils/exception.py @@ -83,4 +83,4 @@ class AllURIsFailedError(Exception): f" - {url}: {exc.__class__.__name__}({exc})" for url, exc in zip(self.urls, self.exceptions) ) - return f"All {len(self.urls)} URIs failed:\n{exc_info}" \ No newline at end of file + return f"All {len(self.urls)} URIs failed:\n{exc_info}" diff --git a/zhenxun/utils/http_utils.py b/zhenxun/utils/http_utils.py index 7f53226d..9f00e9af 100644 --- a/zhenxun/utils/http_utils.py +++ b/zhenxun/utils/http_utils.py @@ -691,4 +691,4 @@ class AsyncHttpx: httpx.AsyncClient: 一个配置好的、临时的客户端实例。 """ async with get_async_client(**kwargs) as client: - yield client \ No newline at end of file + yield client diff --git a/zhenxun/utils/manager/schedule_manager.py b/zhenxun/utils/manager/schedule_manager.py index f69d7a81..a3b21272 100644 --- a/zhenxun/utils/manager/schedule_manager.py +++ b/zhenxun/utils/manager/schedule_manager.py @@ -807,4 +807,4 @@ async def _load_schedules_from_db(): count += 1 else: logger.warning(f"跳过加载定时任务:插件 '{schedule.plugin_name}' 未注册。") - logger.info(f"定时任务加载完成,共成功加载 {count} 个任务。") \ No newline at end of file + logger.info(f"定时任务加载完成,共成功加载 {count} 个任务。")