From 9d10100bedb4e3ca045d6d9eb2ef075b8eaf27b3 Mon Sep 17 00:00:00 2001 From: yusen Date: Tue, 5 Nov 2024 20:17:46 +0800 Subject: [PATCH 1/4] Fix: error param of only_check_version --- gui/components/check_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/components/check_update.py b/gui/components/check_update.py index a71b206..c352871 100644 --- a/gui/components/check_update.py +++ b/gui/components/check_update.py @@ -62,7 +62,7 @@ async def only_check_version(): async def get_newest_version(config): """检查最新版本并下载更新包""" ui.notify(config.get_text("button_check_version")) - resultdict = await only_check_version(config) + resultdict = await only_check_version() ui.notify(resultdict["msg"]) if not resultdict["status"]: return From 4b8c5e85ac2cf1975a7f65ccfc380f92b9ad73bb Mon Sep 17 00:00:00 2001 From: yusen Date: Tue, 5 Nov 2024 20:33:53 +0800 Subject: [PATCH 2/4] chore: text --- common/constant.py | 3 +++ gui/define.py | 4 +--- gui/refactor_pages/json_set_panel.py | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/common/constant.py b/common/constant.py index 56924cb..15e2913 100644 --- a/common/constant.py +++ b/common/constant.py @@ -2,6 +2,9 @@ class TaskName(Enum): + """ + 配置文件里的task任务名称 + """ LOGIN_GAME = "登录游戏" MOMOTALK = "清momotalk" CAFE = "咖啡馆" diff --git a/gui/define.py b/gui/define.py index 30df17c..523747c 100644 --- a/gui/define.py +++ b/gui/define.py @@ -25,10 +25,8 @@ def __init__(self, task_enum: TaskName, json_key_name: str): TaskStr(TaskName.LOGIN_GAME, "task_login_game"), TaskStr(TaskName.MOMOTALK, "task_clear_momotalk"), TaskStr(TaskName.CAFE, "task_cafe"), - # compatibility, just changed display name - TaskStr(TaskName.TACTICAL_CHALLENGE, "task_cafe_deprecated"), - + TaskStr(TaskName.CAFE, "task_cafe_deprecated"), TaskStr(TaskName.TIMETABLE, "task_timetable"), TaskStr(TaskName.CLUB, "task_club"), TaskStr(TaskName.MANUFACTURE, "task_craft"), diff --git a/gui/refactor_pages/json_set_panel.py b/gui/refactor_pages/json_set_panel.py index e2d9435..929f656 100644 --- a/gui/refactor_pages/json_set_panel.py +++ b/gui/refactor_pages/json_set_panel.py @@ -30,6 +30,16 @@ class ConfigPanel: + """ + 连接子页面的i18n名称 与 渲染页面的函数 + + Parameters + ========== + name: str + 子页面标题 + func: + 子页面渲染函数 + """ def __init__(self, name: str, func: Callable[[], None]): self.name = name self.func = func From 254ab52e03ea61ce8bf7a3c99046486c86ed5c99 Mon Sep 17 00:00:00 2001 From: yusen Date: Sat, 9 Nov 2024 13:22:24 +0800 Subject: [PATCH 3/4] Fix: input param i of lambda --- gui/pages/Setting_task_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/pages/Setting_task_order.py b/gui/pages/Setting_task_order.py index ffc97d7..c30f4ed 100644 --- a/gui/pages/Setting_task_order.py +++ b/gui/pages/Setting_task_order.py @@ -29,7 +29,7 @@ def task_order(): ui.label(f'{config.get_text("config_task")} {i+1}:') atask = ui.select(real_taskname_to_show_taskname, value=config.userconfigdict["TASK_ORDER"][i], - on_change=lambda v: config.userconfigdict["TASK_ORDER"].__setitem__(i, v.value)) + on_change=lambda v,i=i: config.userconfigdict["TASK_ORDER"].__setitem__(i, v.value)) acheck = ui.checkbox(config.get_text("button_enable"), value=config.userconfigdict["TASK_ACTIVATE"][i], on_change=lambda v,i=i: config.userconfigdict["TASK_ACTIVATE"].__setitem__(i, v.value)) if i==0: atask.set_enabled(False) From f2bd544b480fed41e638551ce8d31244cfe37640 Mon Sep 17 00:00:00 2001 From: yusen Date: Sat, 9 Nov 2024 13:24:23 +0800 Subject: [PATCH 4/4] chore: downloading text --- update.py | 1 + 1 file changed, 1 insertion(+) diff --git a/update.py b/update.py index b4a3a70..5a89a50 100644 --- a/update.py +++ b/update.py @@ -126,6 +126,7 @@ def check_and_update(): # 根据update.zip结尾的url下载文件 target_url = version_info.update_zip_url targetfilename = os.path.basename(target_url) + print("Dowloading...Please wait") # 不存在zip文件则下载 if not os.path.exists(targetfilename): try: