From b7c4b17992acc802301af1d65179481bc2d159f1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 01:52:06 +0000 Subject: [PATCH] :rotating_light: auto fix by pre-commit hooks --- README.md | 4 +- nonebot_plugin_tarot/__init__.py | 3 +- nonebot_plugin_tarot/config.py | 2 +- nonebot_plugin_tarot/data_source.py | 15 +++---- nonebot_plugin_tarot/tarot.json | 62 ++++------------------------- 5 files changed, 20 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 57451b9..c34beb3 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ _“许多傻瓜对千奇百怪的迷信说法深信不疑:象牙、护身符 ## 安装 1. 安装方式 + - 通过 `pip` 或 `nb-cli` 安装。pypi无法发行过大安装包,由此安装的插件不包含 `./resource` 下提供的塔罗牌主题资源。仓库提供了两种塔罗牌主题,可在 [v0.4.0 release](https://github.com/MinatoAquaCrews/nonebot_plugin_tarot/releases/tag/v0.4.0) Assets下载,部署至本地后修改 `TAROT_PATH` 配置即可; - 通过 `zip` 或 `git clone` 安装:包含 `resource` 下所有塔罗牌主题资源; @@ -89,6 +90,7 @@ _“许多傻瓜对千奇百怪的迷信说法深信不疑:象牙、护身符 TAROT_EXTRA_THEMES=["MyTarotTheme1", "MyTarotTheme2"] GITHUB_PROXY="https://ghproxy.com/https://raw.githubusercontent.com/" # 或者其他代理 ``` + ``` MyTarotResource ├ MyTarotTheme1 @@ -98,7 +100,7 @@ _“许多傻瓜对千奇百怪的迷信说法深信不疑:象牙、护身符 ``` ⚠ 默认使用 `ghproxy.com` 下载仓库内资源,不确保次次成功 - + 👉 [如何添加新的塔罗牌主题资源?](./How-to-add-new-tarot-theme.md) 欢迎贡献!🙏 ## 命令 diff --git a/nonebot_plugin_tarot/__init__.py b/nonebot_plugin_tarot/__init__.py index 629740d..a0e306e 100644 --- a/nonebot_plugin_tarot/__init__.py +++ b/nonebot_plugin_tarot/__init__.py @@ -1,9 +1,10 @@ from typing import NoReturn + from nonebot import on_command, on_regex, require from nonebot.adapters import Event +from nonebot.params import Depends from nonebot.permission import SUPERUSER from nonebot.plugin import PluginMetadata, inherit_supported_adapters -from nonebot.params import Depends from nonebot.rule import Rule require("nonebot_plugin_localstore") # isort:skip diff --git a/nonebot_plugin_tarot/config.py b/nonebot_plugin_tarot/config.py index 7316827..8592578 100644 --- a/nonebot_plugin_tarot/config.py +++ b/nonebot_plugin_tarot/config.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import Sequence, Set, Optional +from typing import Optional, Sequence, Set import httpx import nonebot diff --git a/nonebot_plugin_tarot/data_source.py b/nonebot_plugin_tarot/data_source.py index 98126b0..9c24849 100644 --- a/nonebot_plugin_tarot/data_source.py +++ b/nonebot_plugin_tarot/data_source.py @@ -4,6 +4,7 @@ from io import BytesIO from pathlib import Path from typing import Dict, List, Tuple, Union + from PIL import Image try: @@ -11,15 +12,11 @@ except ModuleNotFoundError: import json -from .config import download_tarot, ResourceError, tarot_config -from nonebot_plugin_saa import ( - AggregatedMessageFactory, - MessageFactory, - PlatformTarget, - TargetQQGroup, - Text, - Image as MessageImage, -) +from nonebot_plugin_saa import AggregatedMessageFactory +from nonebot_plugin_saa import Image as MessageImage +from nonebot_plugin_saa import MessageFactory, PlatformTarget, TargetQQGroup, Text + +from .config import ResourceError, download_tarot, tarot_config CardInfoType = Dict[str, Union[str, Dict[str, str]]] FormationInfoType = Dict[str, Dict[str, Union[int, bool, List[List[str]]]]] diff --git a/nonebot_plugin_tarot/tarot.json b/nonebot_plugin_tarot/tarot.json index a25a307..a6cc422 100644 --- a/nonebot_plugin_tarot/tarot.json +++ b/nonebot_plugin_tarot/tarot.json @@ -5,40 +5,19 @@ "cards_num": 3, "is_cut": false, "representations": [ - [ - "处境", - "行动", - "结果" - ], - [ - "现状", - "愿望", - "行动" - ] + ["处境", "行动", "结果"], + ["现状", "愿望", "行动"] ] }, "时间之流牌阵": { "cards_num": 3, "is_cut": true, - "representations": [ - [ - "过去", - "现在", - "未来", - "问卜者的主观想法" - ] - ] + "representations": [["过去", "现在", "未来", "问卜者的主观想法"]] }, "身心灵牌阵": { "cards_num": 3, "is_cut": false, - "representations": [ - [ - "身体状况", - "心里状况", - "精神状态" - ] - ] + "representations": [["身体状况", "心里状况", "精神状态"]] }, "四要素牌阵": { "cards_num": 4, @@ -56,36 +35,19 @@ "cards_num": 4, "is_cut": false, "representations": [ - [ - "人际关系现状", - "与对方结识的因缘", - "双方关系的发展", - "双方关系的结论" - ] + ["人际关系现状", "与对方结识的因缘", "双方关系的发展", "双方关系的结论"] ] }, "自我探索牌阵": { "cards_num": 4, "is_cut": false, - "representations": [ - [ - "所处的状态", - "外在表现", - "内在想法", - "潜意识" - ] - ] + "representations": [["所处的状态", "外在表现", "内在想法", "潜意识"]] }, "恋人金字塔": { "cards_num": 4, "is_cut": false, "representations": [ - [ - "你的期望", - "恋人的期望", - "目前彼此的关系", - "未来彼此的关系" - ] + ["你的期望", "恋人的期望", "目前彼此的关系", "未来彼此的关系"] ] }, "五牌阵": { @@ -159,15 +121,7 @@ "cards_num": 7, "is_cut": true, "representations": [ - [ - "过去", - "现在", - "未来", - "对策", - "环境", - "态度", - "预测结果" - ] + ["过去", "现在", "未来", "对策", "环境", "态度", "预测结果"] ] } },