Skip to content

Commit

Permalink
VER 1.1.6.1
Browse files Browse the repository at this point in the history
*- Modified error display.
^- Fix dialog return value error.
  • Loading branch information
ren-yc committed Mar 12, 2022
1 parent 8323952 commit 3ed6f70
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 21 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**
Expand Down
31 changes: 15 additions & 16 deletions RandomRollCall.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import webbrowser
import random
from numpy import False_
import yaml
import os
import sys
Expand All @@ -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)")
Expand Down Expand Up @@ -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()
Expand All @@ -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):
Expand All @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions lang/en-Us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Window_Info: "Start"
Version: 1.1.6
6 changes: 4 additions & 2 deletions lang/zh-Hans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "开始"
Window_Info: "开始"
Version: 1.1.6
2 changes: 1 addition & 1 deletion settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Language: zh-Hans
Min: 1
Max: 49
Version: 1.1.5
Version: 1.1.6

0 comments on commit 3ed6f70

Please sign in to comment.