From 3ed6f70d1aed972f4b4edbdf62b38d4396c76c3c Mon Sep 17 00:00:00 2001 From: ren-yc Date: Sat, 12 Mar 2022 15:09:39 +0800 Subject: [PATCH] VER 1.1.6.1 *- Modified error display. ^- Fix dialog return value error. --- CHANGELOG.md | 10 ++++++++++ RandomRollCall.py | 31 +++++++++++++++---------------- lang/en-Us.yml | 6 ++++-- lang/zh-Hans.yml | 6 ++++-- settings.yml | 2 +- 5 files changed, 34 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e42de..b82a4ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ This change log supports two languages: `en-Us` `zh-Hans`. (**Every two lines, t 这个更新日志支持两个语言:`en-Us` `zh-Hans`。(**每两行第一行为 `en-Us` 第二行为 `zh-Hans`**) +## 1.1.6.x + +Add changing number. (The number changes continuously after the first click, and stops after the second click) + +添加不断变化的数字。(第一次点击后数字不断变化,第二次点击后停止) + +Add welcome text. ("Start") + +添加欢迎文本。(“开始”) + ## 1.1.5.x LTS **This version of the program is long term supported.** diff --git a/RandomRollCall.py b/RandomRollCall.py index 9c0ad29..fdbe52e 100644 --- a/RandomRollCall.py +++ b/RandomRollCall.py @@ -1,6 +1,5 @@ import webbrowser import random -from numpy import False_ import yaml import os import sys @@ -16,12 +15,12 @@ # Error def errno_1(): - showerror(title = "Error", message = "[Errno 1] Cannot read settings file data.") - print("ERROR: [Errno 1] Cannot read settings file data.") + showerror(title = "Fatal Error", message = "[Errno 1] Cannot read settings file data.") + print("FATAL ERROR: [Errno 1] Cannot read settings file data.") def errno_2(): - showerror(title = "Error", message = "[Errno 2] Cannot read language file data.") - print("ERROR: [Errno 2] Cannot read language file data.") + showerror(title = "Fatal Error", message = "[Errno 2] Cannot read language file data.") + print("FATAL ERROR: [Errno 2] Cannot read language file data.") def errno_3(): showerror(title = "Error", message = "[Errno 3] Number out of range. (0 < min or max < 100000 and min < max)") @@ -56,12 +55,14 @@ def errno_3(): Lang_Menu_MAX = dic['Ask_Max_Message'] Lang_Menu_Lang = dic['Switch_Lang'] Lang_Switch = dic['Switch_Info'] - Lang_Messagebox_Message = dic['About_Message'] + Lang_Messagebox_Message1 = dic['About_Message1'] + Lang_Messagebox_Message2 = dic['About_Message2'] Lang_Warn = dic['Warn'] Lang_Please_Reopen = dic['Reopen'] Lang_Error = dic['Error'] Lang_Switch_Error_Message = dic['Switch_Lang_Error'] Lang_Window_Info = dic['Window_Info'] + Lang_Version = dic['Version'] file.close() except: errno_2() @@ -74,29 +75,27 @@ def update(): data = {"Language" : default_Lang, "Min" : minnum, "Max" : maxnum, "Version" : version} yaml.dump(data = data, stream = SettingsFile, allow_unicode = True, sort_keys = False) -# Min Max Frontsize +# Dialog def Ask_MIN(): global minnum tmp = askinteger(title = Lang_Menu_MIN, prompt = Lang_Menu_MIN) + if tmp == None: + return if tmp <= 0 or tmp >= maxnum: errno_3() return - if tmp != None: - minnum = tmp - else: - return + minnum = tmp update() def Ask_MAX(): global maxnum tmp = askinteger(title = Lang_Menu_MAX, prompt = Lang_Menu_MAX) + if tmp == None: + return if tmp >= 100000 or tmp <= minnum: errno_3() return - if tmp != None: - maxnum = tmp - else: - return + maxnum = tmp update() def FrontSize(tmp): @@ -118,7 +117,7 @@ def Show_Help(): webbrowser.open("https://github.com/class-tools/RandomRollCall/blob/master/README.md") def Show_About(): - showinfo(title = Lang_Menu_About, message = Lang_Messagebox_Message + version) + showinfo(title = Lang_Menu_About, message = Lang_Messagebox_Message1 + version + Lang_Messagebox_Message2 + Lang_Version) def Ask_Lang(): tmp = askstring(title = Lang_Menu_Lang, prompt = Lang_Switch) diff --git a/lang/en-Us.yml b/lang/en-Us.yml index 0a363b1..a73bb6f 100644 --- a/lang/en-Us.yml +++ b/lang/en-Us.yml @@ -9,7 +9,9 @@ Ask_Min_Message: "Edit minimum student number..." Ask_Max_Message: "Edit maximum student number..." Switch_Lang: "Switch language..." Switch_Info: "Please enter the language code you need to switch to, it currently supports zh-Hans en-Us." -About_Message: "This program uses MIT License\nDeveloper: Class Tools Develop Team - Yuchen Ren\nGithub Repository: https://github.com/class-tools/RandomRollCall\nVersion " +About_Message1: "This program uses MIT License\nDeveloper: Class Tools Develop Team - Yuchen Ren\nGithub Repository: https://github.com/class-tools/RandomRollCall\nVersion " +About_Message2: "\nLanguage File Version " Error: "Error" Switch_Lang_Error: "Unsupported language." -Window_Info: "Start" \ No newline at end of file +Window_Info: "Start" +Version: 1.1.6 \ No newline at end of file diff --git a/lang/zh-Hans.yml b/lang/zh-Hans.yml index f21c6f4..84cc155 100644 --- a/lang/zh-Hans.yml +++ b/lang/zh-Hans.yml @@ -9,7 +9,9 @@ Ask_Min_Message: "编辑最小学号..." Ask_Max_Message: "编辑最大学号..." Switch_Lang: "更改语言..." Switch_Info: "请输入你想要切换至的语言代号,目前支持 zh-Hans en-Us。" -About_Message: "本程序使用 MIT 许可证\n开发者 Class Tools Develop Team - Yuchen Ren\nGithub 存储库:https://github.com/class-tools/RandomRollCall\n版本 " +About_Message1: "本程序使用 MIT 许可证\n开发者 Class Tools Develop Team - Yuchen Ren\nGithub 存储库:https://github.com/class-tools/RandomRollCall\n版本 " +About_Message2: "\n语言文件版本 " Error: "错误" Switch_Lang_Error: "不支持的语言。" -Window_Info: "开始" \ No newline at end of file +Window_Info: "开始" +Version: 1.1.6 \ No newline at end of file diff --git a/settings.yml b/settings.yml index 681b370..ddd1ad7 100644 --- a/settings.yml +++ b/settings.yml @@ -1,4 +1,4 @@ Language: zh-Hans Min: 1 Max: 49 -Version: 1.1.5 +Version: 1.1.6