mirror of
https://github.com/PaiGramTeam/StarRailDamageCal.git
synced 2024-11-16 04:45:43 +00:00
bump to 1.0.4
This commit is contained in:
parent
142a968bcb
commit
e52facaee1
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "starrail_damage_cal"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
description = "For StarRail Role Damage Cal"
|
||||
authors = [
|
||||
{name = "qwerdvd", email = "105906879+qwerdvd@users.noreply.github.com"},
|
||||
|
@ -55,7 +55,7 @@ class DamageCal:
|
||||
raise MihomoRequestError
|
||||
|
||||
if char_id not in char_id_list:
|
||||
raise NotInCharacterShowcaseError
|
||||
raise NotInCharacterShowcaseError(char_id_list)
|
||||
|
||||
char_data = char_data_dict[char_id]
|
||||
return await cls.cal_info(char_data)
|
||||
@ -78,7 +78,7 @@ class DamageCal:
|
||||
raise MihomoRequestError
|
||||
|
||||
if char_id not in char_id_list:
|
||||
raise NotInCharacterShowcaseError
|
||||
raise NotInCharacterShowcaseError(char_id_list)
|
||||
|
||||
char_data = char_data_dict[char_id]
|
||||
return await cls.cal_info(char_data)
|
||||
@ -104,7 +104,7 @@ class DamageCal:
|
||||
|
||||
@classmethod
|
||||
async def get_all_damage_data_by_uid(cls, uid: str):
|
||||
char_id_list, char_data_dict = await api_to_dict(uid=uid)
|
||||
char_id_list, char_data_dict = await api_to_dict(uid)
|
||||
|
||||
if isinstance(char_id_list, str):
|
||||
raise MihomoRequestError
|
||||
|
6
test.py
6
test.py
@ -1,12 +1,12 @@
|
||||
import json
|
||||
from typing import List
|
||||
from typing import List, Union
|
||||
|
||||
from starrail_damage_cal.cal_damage import DamageCal
|
||||
|
||||
|
||||
async def test_get_damage_data_by_uid() -> None:
|
||||
data = await DamageCal.get_damage_data_by_uid(uid="100086290", avatar_name="希儿")
|
||||
if isinstance(data, List):
|
||||
data = await DamageCal.get_all_damage_data_by_uid(uid="102840119")
|
||||
if isinstance(data, Union[List, dict]):
|
||||
print(json.dumps(data, ensure_ascii=False, indent=4))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user