🚨 移除noqa: E501

💄 auto fix by pre-commit hooks
This commit is contained in:
Azide 2023-07-16 17:09:26 +08:00 committed by felinae98
parent e50eb5d70b
commit bf788ff72a
22 changed files with 98 additions and 66 deletions

View File

@ -16,7 +16,7 @@ __help__plugin__name__ = "nonebot_bison"
__usage__ = (
"本bot可以提供b站、微博等社交媒体的消息订阅详情请查看本bot文档"
f"或者{'at本bot' if plugin_config.bison_to_me else '' }发送“添加订阅”订阅第一个帐号,"
f"发送“查询订阅”或“删除订阅”管理订阅"
"发送“查询订阅”或“删除订阅”管理订阅"
)
__supported_adapters__ = nonebot_plugin_saa.__plugin_meta__.supported_adapters

View File

@ -57,9 +57,7 @@ def init_fastapi():
port = driver.config.port
if host in ["0.0.0.0", "127.0.0.1"]:
host = "localhost"
logger.opt(colors=True).info(
f"Nonebot Bison frontend will be running at: " f"<b><u>http://{host}:{port}/bison</u></b>"
)
logger.opt(colors=True).info(f"Nonebot Bison frontend will be running at: <b><u>http://{host}:{port}/bison</u></b>")
logger.opt(colors=True).info("该页面不能被直接访问请私聊bot <b><u>后台管理</u></b> 以获取可访问地址")
@ -72,7 +70,7 @@ def register_get_token_handler():
await get_token.finish(f"请访问: {plugin_config.bison_outer_url}auth/{token}")
get_token.__help__name__ = "获取后台管理地址" # type: ignore
get_token.__help__info__ = "获取管理bot后台的地址该地址会" "在一段时间过后过期,请不要泄漏该地址" # type: ignore
get_token.__help__info__ = "获取管理bot后台的地址该地址会在一段时间过后过期,请不要泄漏该地址" # type: ignore
def check_driver_is_fastapi() -> bool:

View File

@ -52,9 +52,7 @@ class DBConfig:
if not db_user:
db_user = User(user_target=user.dict())
session.add(db_user)
db_target_stmt = (
select(Target).where(Target.platform_name == platform_name).where(Target.target == target)
)
db_target_stmt = select(Target).where(Target.platform_name == platform_name).where(Target.target == target)
db_target: Target | None = await session.scalar(db_target_stmt)
if not db_target:
db_target = Target(target=target, platform_name=platform_name, target_name=target_name)

View File

@ -32,7 +32,8 @@ async def data_migrate():
if key in user_sub_set:
# a user subscribe a target twice
logger.error(
f"用户 {user['user_type']}-{user['user']} 订阅了 {platform_name}-{target_name} 两次,随机采用了一个订阅" # noqa: E501
f"用户 {user['user_type']}-{user['user']} 订阅了 {platform_name}-{target_name} 两次,"
"随机采用了一个订阅",
)
continue
user_sub_set.add(key)

View File

@ -113,9 +113,13 @@ class AkVersion(StatusChange):
def compare_status(self, _, old_status, new_status):
res = []
if old_status.get("preAnnounceType") == 2 and new_status.get("preAnnounceType") == 0:
res.append(Post("arknights", text="登录界面维护公告上线(大概是开始维护了)", target_name="明日方舟更新信息")) # noqa: E501
res.append(
Post("arknights", text="登录界面维护公告上线(大概是开始维护了)", target_name="明日方舟更新信息")
)
elif old_status.get("preAnnounceType") == 0 and new_status.get("preAnnounceType") == 2:
res.append(Post("arknights", text="登录界面维护公告下线(大概是开服了,冲!)", target_name="明日方舟更新信息")) # noqa: E501
res.append(
Post("arknights", text="登录界面维护公告下线(大概是开服了,冲!)", target_name="明日方舟更新信息")
)
if old_status.get("clientVersion") != new_status.get("clientVersion"):
res.append(Post("arknights", text="游戏本体更新(大更新)", target_name="明日方舟更新信息"))
if old_status.get("resVersion") != new_status.get("resVersion"):

View File

@ -54,7 +54,7 @@ class Bilibili(NewMessage):
2: "专栏文章",
3: "视频",
4: "纯文字",
5: "转发"
5: "转发",
# 5: "短视频"
}
platform_name = "bilibili"

View File

@ -82,9 +82,7 @@ class Platform(metaclass=PlatformABCMeta, base=True):
...
@abstractmethod
async def fetch_new_post(
self, target: Target, users: list[UserSubInfo]
) -> list[tuple[PlatformTarget, list[Post]]]:
async def fetch_new_post(self, target: Target, users: list[UserSubInfo]) -> list[tuple[PlatformTarget, list[Post]]]:
...
async def do_fetch_new_post(
@ -300,9 +298,7 @@ class NewMessage(MessageProcess, abstract=True):
self.set_stored_data(target, store)
return res
async def fetch_new_post(
self, target: Target, users: list[UserSubInfo]
) -> list[tuple[PlatformTarget, list[Post]]]:
async def fetch_new_post(self, target: Target, users: list[UserSubInfo]) -> list[tuple[PlatformTarget, list[Post]]]:
post_list = await self.get_sub_list(target)
new_posts = await self.filter_common_with_diff(target, post_list)
if not new_posts:
@ -339,9 +335,7 @@ class StatusChange(Platform, abstract=True):
async def parse(self, raw_post: RawPost) -> Post:
...
async def fetch_new_post(
self, target: Target, users: list[UserSubInfo]
) -> list[tuple[PlatformTarget, list[Post]]]:
async def fetch_new_post(self, target: Target, users: list[UserSubInfo]) -> list[tuple[PlatformTarget, list[Post]]]:
try:
new_status = await self.get_status(target)
except self.FetchError as err:
@ -367,9 +361,7 @@ class StatusChange(Platform, abstract=True):
class SimplePost(MessageProcess, abstract=True):
"Fetch a list of messages, dispatch it to different users"
async def fetch_new_post(
self, target: Target, users: list[UserSubInfo]
) -> list[tuple[PlatformTarget, list[Post]]]:
async def fetch_new_post(self, target: Target, users: list[UserSubInfo]) -> list[tuple[PlatformTarget, list[Post]]]:
new_posts = await self.get_sub_list(target)
if not new_posts:
return []

View File

@ -112,8 +112,10 @@ class Weibo(NewMessage):
async def parse(self, raw_post: RawPost) -> Post:
header = {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,"
"*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept": (
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,"
"*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
),
"accept-language": "zh-CN,zh;q=0.9",
"authority": "m.weibo.cn",
"cache-control": "max-age=0",
@ -121,9 +123,11 @@ class Weibo(NewMessage):
"sec-fetch-mode": "same-origin",
"sec-fetch-site": "same-origin",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) "
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 "
"Mobile Safari/537.36",
"user-agent": (
"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) "
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 "
"Mobile Safari/537.36"
),
}
info = raw_post["mblog"]
retweeted = False

View File

@ -16,9 +16,7 @@ class PlugConfig(BaseSettings):
bison_resend_times: int = 0
bison_proxy: str | None
bison_ua: str = (
"Mozilla/5.0 (X11; Linux x86_64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/51.0.2704.103 Safari/537.36"
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
)
bison_show_network_warning: bool = True

View File

@ -69,9 +69,7 @@ class Scheduler:
if not (schedulable := await self.get_next_schedulable()):
return
logger.trace(f"scheduler {self.name} fetching next target: [{schedulable.platform_name}]{schedulable.target}")
send_userinfo_list = await config.get_platform_target_subscribers(
schedulable.platform_name, schedulable.target
)
send_userinfo_list = await config.get_platform_target_subscribers(schedulable.platform_name, schedulable.target)
client = await self.scheduler_config_obj.get_client(schedulable.target)
context.register_to_client(client)

View File

@ -91,7 +91,7 @@ def do_add_sub(add_sub: type[Matcher]):
else:
await add_sub.send(
f"即将订阅的用户为:{state['platform']} {state['name']} {state['id']}\n如有错误请输入“取消”重新订阅"
) # noqa: E501
)
@add_sub.handle()
async def prepare_get_categories(matcher: Matcher, state: T_State):
@ -120,7 +120,9 @@ def do_add_sub(add_sub: type[Matcher]):
matcher.set_arg("raw_tags", None) # type: ignore
state["tags"] = []
return
state["_prompt"] = "请输入要订阅/屏蔽的标签(不含#号)\n" "多个标签请使用空格隔开\n" '订阅所有标签输入"全部标签"\n' '具体规则回复"详情"' # noqa: E501
state["_prompt"] = (
'请输入要订阅/屏蔽的标签(不含#号)\n多个标签请使用空格隔开\n订阅所有标签输入"全部标签"\n具体规则回复"详情"'
)
@add_sub.got("raw_tags", MessageTemplate("{_prompt}"), [handle_cancel])
async def parser_tags(state: T_State, raw_tags: Message = Arg()):

View File

@ -33,9 +33,7 @@ class ProcessContext:
res = []
for req in self.reqs:
if self._should_print_content(req):
log_content = (
f"{req.request.url} {req.request.headers} | [{req.status_code}] {req.headers} {req.text}"
)
log_content = f"{req.request.url} {req.request.headers} | [{req.status_code}] {req.headers} {req.text}"
else:
log_content = (
f"{req.request.url} {req.request.headers} | [{req.status_code}] {req.headers} "

View File

@ -85,7 +85,8 @@ line-length = 120
target-version = "py310"
[tool.black]
line-length = 118
line-length = 120
preview = true
target-version = ["py310", "py311"]
include = '\.pyi?$'
extend-exclude = '''

View File

@ -45,7 +45,10 @@ async def test_video_forward(bilibili, bing_dy_list):
post = await bilibili.parse(bing_dy_list[1])
assert (
post.text
== "答案揭晓:宿舍!来看看投票结果\nhttps://t.bilibili.com/568093580488553786\n--------------\n#可露希尔的秘密档案# \n11来宿舍休息一下吧 \n档案来源lambda:\\罗德岛内务\\秘密档案 \n发布时间9/12 1:00 P.M. \n档案类型:可见 \n档案描述:今天请了病假在宿舍休息。很舒适。 \n提供者:赫默\n=================\n《可露希尔的秘密档案》11话来宿舍休息一下吧" # noqa: E501
== "答案揭晓:宿舍!来看看投票结果\nhttps://t.bilibili.com/568093580488553786\n--------------\n#可露希尔的秘密档案#"
" \n11来宿舍休息一下吧 \n档案来源lambda:\\罗德岛内务\\秘密档案 \n发布时间9/12 1:00 P.M."
" \n档案类型:可见 \n档案描述:今天请了病假在宿舍休息。很舒适。"
" \n提供者:赫默\n=================\n《可露希尔的秘密档案》11话来宿舍休息一下吧"
)
@ -54,9 +57,17 @@ async def test_article_forward(bilibili, bing_dy_list):
post = await bilibili.parse(bing_dy_list[4])
assert (
post.text
== "#明日方舟##饼学大厦#\n9.11专栏更新完毕,这还塌了实属没跟新运营对上\n后边除了周日发饼和PV没提及的中文语音稳了\n别忘了来参加#可露希尔的秘密档案#的主题投票\nhttps://t.bilibili.com/568093580488553786?tab=2"
== "#明日方舟##饼学大厦#\n9.11专栏更新完毕,"
"这还塌了实属没跟新运营对上\n后边除了周日发饼和PV没提及的中文语音"
"稳了\n别忘了来参加#可露希尔的秘密档案#的主题投票\nhttps://t.bilibili.com/568093580488553786?tab=2"
+ "\n--------------\n"
+ "【明日方舟】饼学大厦#12~14风暴瞭望&玛莉娅·临光&红松林&感谢庆典9.11更新 更新记录09.11更新覆盖09.10更新以及排期更新猜测周一周五开活动09.10更新以周五开活动为底PV/公告调整位置整体结构更新09.08更新:饼学大厦#12更新新增一件六星商店服饰周日发饼09.06更新饼学大厦整栋整栋翻新改为9.16开主线四日无饼09.05凌晨更新10.13后的排期(两日无饼,鹰角背刺,心狠手辣)前言感谢楪筱祈ぺ的动态-哔哩哔哩 (bilibili.com) 对饼学的贡献后续排期9.17【风暴瞭望】、10.01【玛莉娅·临光】复刻、10.1" # noqa: E501
+ "【明日方舟】饼学大厦#12~14风暴瞭望&玛莉娅·临光&红松林&感谢庆典9.11更新"
" 更新记录09.11更新覆盖09.10更新以及排期更新猜测周一周五开活动09.10更新:以周五开活动为底,"
"PV/公告调整位置整体结构更新09.08更新:饼学大厦#12更新"
"新增一件六星商店服饰周日发饼09.06更新:饼学大厦整栋整栋翻新,"
"改为9.16开主线四日无饼09.05凌晨更新10.13后的排期(两日无饼,鹰角背刺,"
"心狠手辣)前言感谢楪筱祈ぺ的动态-哔哩哔哩 (bilibili.com) 对饼学的贡献后续排期9.17【风暴瞭望】、"
"10.01【玛莉娅·临光】复刻、10.1"
)
@ -65,9 +76,14 @@ async def test_dynamic_forward(bilibili, bing_dy_list):
post = await bilibili.parse(bing_dy_list[5])
assert (
post.text
== "饼组主线饼学预测——9.11版\n①今日结果\n9.11 殿堂上的游禽-星极(x新运营实锤了)\n②后续预测\n9.12 #罗德岛相簿#+#可露希尔的秘密档案#11话\n9.13 六星先锋(执旗手)干员-琴柳\n9.14 宣传策略-空弦+家具\n9.15 轮换池(+中文语音前瞻)\n9.16 停机\n9.17 #罗德岛闲逛部#+新六星EP+EP09·风暴瞭望开启\n9.19 #罗德岛相簿#" # noqa: E501
== "饼组主线饼学预测——9.11版\n①今日结果\n9.11 殿堂上的游禽-星极(x"
"新运营实锤了)\n②后续预测\n9.12 #罗德岛相簿#+#可露希尔的秘密档案#11话\n9.13"
" 六星先锋(执旗手)干员-琴柳\n9.14 宣传策略-空弦+家具\n9.15 轮换池(+中文语音前瞻)\n9.16"
" 停机\n9.17 #罗德岛闲逛部#+新六星EP+EP09·风暴瞭望开启\n9.19 #罗德岛相簿#"
+ "\n--------------\n"
+ "#明日方舟#\n【新增服饰】\n//殿堂上的游禽 - 星极\n塞壬唱片偶像企划《闪耀阶梯》特供服饰/殿堂上的游禽。星极自费参加了这项企划,尝试着用大众能接受的方式演绎天空之上的故事。\n\n_____________\n谦逊留给观众,骄傲发自歌喉,此夜,唯我璀璨。 " # noqa: E501
+ "#明日方舟#\n【新增服饰】\n//殿堂上的游禽 - 星极\n塞壬唱片偶像企划《闪耀阶梯》特供服饰/殿堂上的游禽。"
"星极自费参加了这项企划,尝试着用大众能接受的方式演绎天空之上的故事。\n\n_____________\n谦逊留给观众,"
"骄傲发自歌喉,此夜,唯我璀璨。 "
)
@ -108,7 +124,9 @@ async def test_fetch_new(bilibili, dummy_user_subinfo):
post = res2[0][1][0]
assert (
post.text
== "#罗德厨房——回甘##明日方舟#\r\n明日方舟官方美食漫画,正式开餐。\r\n往事如烟,安然即好。\r\nMenu 01高脚羽兽烤串与罗德岛的领袖\r\n\r\n哔哩哔哩漫画阅读https://manga.bilibili.com/detail/mc31998?from=manga_search\r\n\r\n关注并转发本动态我们将会在5月27日抽取10位博士赠送【兔兔奇境】周边礼盒一份。 互动抽奖" # noqa: E501
== "#罗德厨房——回甘##明日方舟#\r\n明日方舟官方美食漫画,正式开餐。\r\n往事如烟,安然即好。\r\nMenu"
" 01高脚羽兽烤串与罗德岛的领袖\r\n\r\n哔哩哔哩漫画阅读https://manga.bilibili.com/detail/mc31998?from=manga_search\r\n\r\n关注并转发本动态,"
"我们将会在5月27日抽取10位博士赠送【兔兔奇境】周边礼盒一份。 互动抽奖"
)

View File

@ -349,9 +349,7 @@ async def test_new_message_target_without_cats_tags(mock_platform_without_cats_t
async def test_new_message_target(mock_platform, user_info_factory):
from nonebot_bison.utils import ProcessContext
res1 = await mock_platform(ProcessContext(), AsyncClient()).fetch_new_post(
"dummy", [user_info_factory([1, 2], [])]
)
res1 = await mock_platform(ProcessContext(), AsyncClient()).fetch_new_post("dummy", [user_info_factory([1, 2], [])])
assert len(res1) == 0
res2 = await mock_platform(ProcessContext(), AsyncClient()).fetch_new_post(
"dummy",

View File

@ -117,7 +117,17 @@ async def test_rsshub_compare(weibo):
test_post = {
"mblog": {
"text": '<a href="https://m.weibo.cn/search?containerid=231522type%3D1%26t%3D10%26q%3D%23%E5%88%9A%E5%87%BA%E7%94%9F%E7%9A%84%E5%B0%8F%E7%BE%8A%E9%A9%BC%E9%95%BF%E5%95%A5%E6%A0%B7%23&extparam=%23%E5%88%9A%E5%87%BA%E7%94%9F%E7%9A%84%E5%B0%8F%E7%BE%8A%E9%A9%BC%E9%95%BF%E5%95%A5%E6%A0%B7%23&luicode=10000011&lfid=1076036003966749" data-hide=""><span class="surl-text">#刚出生的小羊驼长啥样#</span></a> <br />小羊驼三三来也<span class="url-icon"><img alt=[好喜欢] src="https://h5.sinaimg.cn/m/emoticon/icon/lxh/lxh_haoxihuan-51860b62e6.png" style="width:1em; height:1em;" /></span><br /><a href="https://m.weibo.cn/p/index?extparam=%E5%B0%8F%E7%BE%8A%E9%A9%BC%E4%B8%89%E4%B8%89&containerid=1008085ae16d2046db677de1b8491d2b708597&luicode=10000011&lfid=1076036003966749" data-hide=""><span class=\'url-icon\'><img style=\'width: 1rem;height: 1rem\' src=\'https://n.sinaimg.cn/photo/5213b46e/20180926/timeline_card_small_super_default.png\'></span><span class="surl-text">小羊驼三三</span></a> ', # noqa
"text": ( # noqa
'<a href="https://m.weibo.cn/search?containerid=231522type%3D1%26t%3D10%26q%3D%23%E5%88%9A%E5%87%BA%E7%94%9F%E7%9A%84%E5%B0%8F%E7%BE%8A%E9%A9%BC%E9%95%BF%E5%95%A5%E6%A0%B7%23&extparam=%23%E5%88%9A%E5%87%BA%E7%94%9F%E7%9A%84%E5%B0%8F%E7%BE%8A%E9%A9%BC%E9%95%BF%E5%95%A5%E6%A0%B7%23&luicode=10000011&lfid=1076036003966749"'
' data-hide=""><span class="surl-text">#刚出生的小羊驼长啥样#</span></a> <br />小羊驼三三来也<span'
' class="url-icon"><img alt=[好喜欢]'
' src="https://h5.sinaimg.cn/m/emoticon/icon/lxh/lxh_haoxihuan-51860b62e6.png" style="width:1em;'
' height:1em;" /></span><br /><a '
' href="https://m.weibo.cn/p/index?extparam=%E5%B0%8F%E7%BE%8A%E9%A9%BC%E4%B8%89%E4%B8%89&containerid=1008085ae16d2046db677de1b8491d2b708597&luicode=10000011&lfid=1076036003966749"'
" data-hide=\"\"><span class='url-icon'><img style='width: 1rem;height: 1rem'"
" src='https://n.sinaimg.cn/photo/5213b46e/20180926/timeline_card_small_super_default.png'></span><span"
' class="surl-text">小羊驼三三</span></a> '
),
"bid": "KnssqeqKK",
}
}

View File

@ -249,7 +249,10 @@ async def test_abort_del_sub(app: App, init_scheduler):
should_send_saa(
ctx,
MessageFactory(
"订阅的帐号为:\n1 weibo 明日方舟Arknights 6279793937\n [图文] 明日方舟\n请输入要删除的订阅的序号\n输入'取消'中止" # noqa: E501
"订阅的帐号为:\n"
+ "1 weibo 明日方舟Arknights 6279793937\n"
+ " [图文] 明日方舟\n"
+ "请输入要删除的订阅的序号\n输入'取消'中止",
),
bot,
event=event,

View File

@ -67,7 +67,10 @@ async def test_del_sub(app: App, init_scheduler):
should_send_saa(
ctx,
MessageFactory(
"订阅的帐号为:\n1 weibo 明日方舟Arknights 6279793937\n [图文] 明日方舟\n请输入要删除的订阅的序号\n输入'取消'中止" # noqa: E501
"订阅的帐号为:\n"
+ "1 weibo 明日方舟Arknights 6279793937\n"
+ " [图文] 明日方舟\n"
+ "请输入要删除的订阅的序号\n输入'取消'中止",
),
bot,
event=event,

View File

@ -16,5 +16,8 @@ async def test_http_error(app: App):
await client.get("https://example.com")
assert ctx.gen_req_records() == [
"https://example.com Headers({'host': 'example.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate', 'connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'}) | [403] Headers({'content-length': '15', 'content-type': 'application/json'}) {\"error\": \"gg\"}" # noqa: E501
"https://example.com Headers({'host': 'example.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate',"
" 'connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like"
" Gecko) Chrome/51.0.2704.103 Safari/537.36'}) | [403] Headers({'content-length': '15', 'content-type':"
' \'application/json\'}) {"error": "gg"}'
]

View File

@ -24,7 +24,10 @@ def ms_list():
@pytest.fixture()
def expected_md():
return "【Zc】每早合约日替攻略<br>![Image](http://i0.hdslb.com/bfs/live/new_room_cover/cf7d4d3b2f336c6dba299644c3af952c5db82612.jpg)\n来源: Bilibili直播 魔法Zc目录<br>详情: https://live.bilibili.com/3044248<br>" # noqa: E501
return (
"【Zc】每早合约日替攻略<br>![Image](http://i0.hdslb.com/bfs/live/new_room_cover/cf7d4d3b2f336c6dba299644c3af952c5db82612.jpg)\n来源:"
" Bilibili直播 魔法Zc目录<br>详情: https://live.bilibili.com/3044248<br>"
)
def test_gene_md(app: App, expected_md, ms_list):

View File

@ -13,13 +13,10 @@ async def test_render(app: App):
plugin_config.bison_use_pic = True
res = await parse_text(
"""a\nbbbbbbbbbbbbbbbbbbbbbb\ncd
<h1>中文</h1>
VuePress 由两部分组成第一部分是一个极简静态网站生成器
(opens new window)它包含由 Vue 驱动的主题系统和插件 API另一个部分是为书写技术文档而优化的默认主题它的诞生初衷是为了支持 Vue 及其子项目的文档需求
每一个由 VuePress 生成的页面都带有预渲染好的 HTML也因此具有非常好的加载性能和搜索引擎优化SEO同时一旦页面被加载Vue 将接管这些静态内容并将其转换成一个完整的单页应用SPA其他的页面则会只在用户浏览到的时候才按需加载
""" # noqa: E501
"a\nbbbbbbbbbbbbbbbbbbbbbb\ncd\n<h1>中文</h1>VuePress 由两部分组成:第一部分是一个极简静态网站生成器(opens new"
" window),它包含由 Vue 驱动的主题系统和插件 API另一个部分是为书写技术文档而优化的默认主题"
"它的诞生初衷是为了支持 Vue 及其子项目的文档需求。每一个由 VuePress 生成的页面都带有预渲染好的 HTML"
"也因此具有非常好的加载性能和搜索引擎优化SEO。同时一旦页面被加载Vue 将接管这些静态内容,"
"并将其转换成一个完整的单页应用SPA其他的页面则会只在用户浏览到的时候才按需加载。"
)
assert isinstance(res, Image)

View File

@ -117,7 +117,8 @@ class BotReply:
@staticmethod
def add_reply_on_cats(platform_manager, platform: str):
return (
f"请输入要订阅的类别,以空格分隔,支持的类别有:{' '.join(list(platform_manager[platform].categories.values()))}" # noqa: E501
"请输入要订阅的类别,以空格分隔,"
f"支持的类别有:{' '.join(list(platform_manager[platform].categories.values()))}"
)
@staticmethod
@ -138,6 +139,8 @@ class BotReply:
add_reply_on_id_input_error = "id输入错误"
add_reply_on_target_parse_input_error = "不能从你的输入中提取出id请检查你输入的内容是否符合预期"
add_reply_on_platform_input_error = "平台输入错误"
add_reply_on_tags = '请输入要订阅/屏蔽的标签(不含#号)\n多个标签请使用空格隔开\n订阅所有标签输入"全部标签"\n具体规则回复"详情"' # noqa: E501
add_reply_on_tags_need_more_info = "订阅标签直接输入标签内容\n屏蔽标签请在标签名称前添加~号\n详见https://nonebot-bison.netlify.app/usage/#%E5%B9%B3%E5%8F%B0%E8%AE%A2%E9%98%85%E6%A0%87%E7%AD%BE-tag" # noqa: E501
add_reply_on_tags = (
'请输入要订阅/屏蔽的标签(不含#号)\n多个标签请使用空格隔开\n订阅所有标签输入"全部标签"\n具体规则回复"详情"'
)
add_reply_on_tags_need_more_info = "订阅标签直接输入标签内容\n屏蔽标签请在标签名称前添加~号\n详见https://nonebot-bison.netlify.app/usage/#%E5%B9%B3%E5%8F%B0%E8%AE%A2%E9%98%85%E6%A0%87%E7%AD%BE-tag"
add_reply_abort = "已中止订阅"