From e52facaee1b6ab07917cbee66306144f2c2ccf05 Mon Sep 17 00:00:00 2001 From: qwerdvd <105906879+qwerdvd@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:06:46 +0800 Subject: [PATCH] bump to 1.0.4 --- pyproject.toml | 2 +- starrail_damage_cal/cal_damage.py | 6 +++--- test.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3df5a3f..c5bbad1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"}, diff --git a/starrail_damage_cal/cal_damage.py b/starrail_damage_cal/cal_damage.py index 1c1e2f3..29c2f35 100644 --- a/starrail_damage_cal/cal_damage.py +++ b/starrail_damage_cal/cal_damage.py @@ -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 diff --git a/test.py b/test.py index 941e296..7144f2c 100644 --- a/test.py +++ b/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))