Skip to content

Commit

Permalink
style: Format with black 24.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Mar 29, 2024
1 parent 07403cf commit e1fe087
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
4 changes: 3 additions & 1 deletion func/fetch_light_cones.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ async def fetch_light_cones():
try:
await get_single_light_cone(f"{light_cone_yatta_url}/{light_cone_id}")
except ValidationError:
print(f"{light_cone_yatta_url}/{light_cone_id} 获取光锥数据失败,数据格式异常")
print(
f"{light_cone_yatta_url}/{light_cone_id} 获取光锥数据失败,数据格式异常"
)
print("获取光锥数据完成")
await dump_light_cones()
28 changes: 24 additions & 4 deletions res_func/head_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
from .avatar import load_icons
from .base_data import get_base_data
from .client import client
from .url import avatar_player_icon_url, player_icon_url, item_player_card_url, text_map, icons_url, base_enka_url
from .url import (
avatar_player_icon_url,
player_icon_url,
item_player_card_url,
text_map,
icons_url,
base_enka_url,
)

data_path = Path("data")

Expand Down Expand Up @@ -63,7 +70,9 @@ async def test_enka_url(path: str) -> str:
return url


async def extra_head_icons(item_player_card: List[ItemPlayerCard], player_icon: List[PlayerIcon]) -> List[HeadIcon]:
async def extra_head_icons(
item_player_card: List[ItemPlayerCard], player_icon: List[PlayerIcon]
) -> List[HeadIcon]:
player_icon_map: Dict[int, PlayerIcon] = {i.ID: i for i in player_icon}
text_map_ = await get_text_map()
station_urls = await parse_station_urls()
Expand All @@ -79,7 +88,9 @@ async def extra_head_icons(item_player_card: List[ItemPlayerCard], player_icon:
station_url = station_urls.get(name, "")
enka_url = await test_enka_url(icon)
icons = [station_url, enka_url]
datas.append(HeadIcon(id=id_, name=name, desc=desc, bg_desc=bg_desc, icons=icons))
datas.append(
HeadIcon(id=id_, name=name, desc=desc, bg_desc=bg_desc, icons=icons)
)
return datas


Expand All @@ -100,7 +111,16 @@ async def avatar_head_icons(avatar_player_icon: List[AvatarPlayerIcon]):
station_url = avatar.icon_ or ""
enka_url = await test_enka_url(i.ImagePath)
icons = [station_url, enka_url]
datas.append(HeadIcon(id=i.ID, name=name, desc="", bg_desc="", avatar_id=i.AvatarID, icons=icons))
datas.append(
HeadIcon(
id=i.ID,
name=name,
desc="",
bg_desc="",
avatar_id=i.AvatarID,
icons=icons,
)
)
return datas


Expand Down

0 comments on commit e1fe087

Please sign in to comment.