diff --git a/src/nonebot_plugins/trimo_plugin_msctconverter/checker.py b/src/nonebot_plugins/trimo_plugin_msctconverter/checker.py deleted file mode 100644 index f5881ab..0000000 --- a/src/nonebot_plugins/trimo_plugin_msctconverter/checker.py +++ /dev/null @@ -1,62 +0,0 @@ - - - -def isin(sth: str, range_list: dict): - sth = sth.lower() - for bool_value, res_list in range_list.items(): - if sth in res_list: - return bool_value - raise ValueError( - "不在可选范围内:{}".format([j for i in range_list.values() for j in i]) - ) - - -# 真假字符串判断 -def bool_str(sth: str): - try: - return bool(float(sth)) - except ValueError: - if str(sth).lower() in ("true", "真", "是", "y", "t"): - return True - elif str(sth).lower() in ("false", "假", "否", "f", "n"): - return False - else: - raise ValueError("非法逻辑字串") - - -def float_str(sth: str): - try: - return float(sth) - except ValueError: - return float( - sth.replace("壹", "1") - .replace("贰", "2") - .replace("叁", "3") - .replace("肆", "4") - .replace("伍", "5") - .replace("陆", "6") - .replace("柒", "7") - .replace("捌", "8") - .replace("玖", "9") - .replace("零", "0") - .replace("一", "1") - .replace("二", "2") - .replace("三", "3") - .replace("四", "4") - .replace("五", "5") - .replace("六", "6") - .replace("七", "7") - .replace("八", "8") - .replace("九", "9") - .replace("〇", "0") - .replace("洞", "0") - .replace("幺", "1") - .replace("俩", "2") - .replace("两", "2") - .replace("拐", "7") - .replace("点", ".") - ) - - -def int_str(sth: str): - return int(float_str(sth)) diff --git a/src/nonebot_plugins/trimo_plugin_msctconverter/utils.py b/src/nonebot_plugins/trimo_plugin_msctconverter/utils.py index c2103de..116b6ff 100644 --- a/src/nonebot_plugins/trimo_plugin_msctconverter/utils.py +++ b/src/nonebot_plugins/trimo_plugin_msctconverter/utils.py @@ -1,6 +1,8 @@ import zhDateTime from typing import Optional + + def hanzi_timeid( zhd: Optional[zhDateTime.zhDateTime] = None, ) -> str: @@ -28,3 +30,65 @@ def hanzi_timeid( + ("" if (zhd.microseconds) else "整") ), ).strip() + + + +# def isin(sth: str, range_list: dict): +# sth = sth.lower() +# for bool_value, res_list in range_list.items(): +# if sth in res_list: +# return bool_value +# raise ValueError( +# "不在可选范围内:{}".format([j for i in range_list.values() for j in i]) +# ) + + +# # 真假字符串判断 +# def bool_str(sth: str): +# try: +# return bool(float(sth)) +# except ValueError: +# if str(sth).lower() in ("true", "真", "是", "y", "t"): +# return True +# elif str(sth).lower() in ("false", "假", "否", "f", "n"): +# return False +# else: +# raise ValueError("非法逻辑字串") + + +# def float_str(sth: str): +# try: +# return float(sth) +# except ValueError: +# return float( +# sth.replace("壹", "1") +# .replace("贰", "2") +# .replace("叁", "3") +# .replace("肆", "4") +# .replace("伍", "5") +# .replace("陆", "6") +# .replace("柒", "7") +# .replace("捌", "8") +# .replace("玖", "9") +# .replace("零", "0") +# .replace("一", "1") +# .replace("二", "2") +# .replace("三", "3") +# .replace("四", "4") +# .replace("五", "5") +# .replace("六", "6") +# .replace("七", "7") +# .replace("八", "8") +# .replace("九", "9") +# .replace("〇", "0") +# .replace("洞", "0") +# .replace("幺", "1") +# .replace("俩", "2") +# .replace("两", "2") +# .replace("拐", "7") +# .replace("点", ".") +# ) + + +# def int_str(sth: str): +# return int(float_str(sth)) diff --git a/src/resources/vanilla_resource/templates/img/bg1.jpg b/src/resources/vanilla_resource/templates/img/bg1.jpg index 3e3849f..3c884f7 100644 Binary files a/src/resources/vanilla_resource/templates/img/bg1.jpg and b/src/resources/vanilla_resource/templates/img/bg1.jpg differ diff --git a/src/resources/vanilla_resource/templates/img/bg2.jpg b/src/resources/vanilla_resource/templates/img/bg2.jpg index a45530f..2597cf0 100644 Binary files a/src/resources/vanilla_resource/templates/img/bg2.jpg and b/src/resources/vanilla_resource/templates/img/bg2.jpg differ diff --git a/src/resources/vanilla_resource/templates/img/bg3.jpg b/src/resources/vanilla_resource/templates/img/bg3.jpg index 2bdc5f1..5f96041 100644 Binary files a/src/resources/vanilla_resource/templates/img/bg3.jpg and b/src/resources/vanilla_resource/templates/img/bg3.jpg differ diff --git a/src/resources/vanilla_resource/templates/img/bg4.jpg b/src/resources/vanilla_resource/templates/img/bg4.jpg index 5a33aa7..5e93522 100644 Binary files a/src/resources/vanilla_resource/templates/img/bg4.jpg and b/src/resources/vanilla_resource/templates/img/bg4.jpg differ diff --git a/src/resources/vanilla_resource/templates/img/bg5.jpg b/src/resources/vanilla_resource/templates/img/bg5.jpg index ca06617..acdcf6f 100644 Binary files a/src/resources/vanilla_resource/templates/img/bg5.jpg and b/src/resources/vanilla_resource/templates/img/bg5.jpg differ diff --git a/src/resources/vanilla_resource/templates/img/bg6.jpg b/src/resources/vanilla_resource/templates/img/bg6.jpg index 76ba3b2..6590c4c 100644 Binary files a/src/resources/vanilla_resource/templates/img/bg6.jpg and b/src/resources/vanilla_resource/templates/img/bg6.jpg differ diff --git a/src/resources/vanilla_resource/templates/img/bg7.jpg b/src/resources/vanilla_resource/templates/img/bg7.jpg index 05e57dc..ec1872e 100644 Binary files a/src/resources/vanilla_resource/templates/img/bg7.jpg and b/src/resources/vanilla_resource/templates/img/bg7.jpg differ