🚨 移除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
+6 -2
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"):
+1 -1
View File
@@ -54,7 +54,7 @@ class Bilibili(NewMessage):
2: "专栏文章",
3: "视频",
4: "纯文字",
5: "转发"
5: "转发",
# 5: "短视频"
}
platform_name = "bilibili"
+4 -12
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 []
+9 -5
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