紧急更新--v2.0.0.5 修复滚动条GUI严重BUG,更正版本号错误

This commit is contained in:
HCha
2023-02-16 00:00:10 +08:00
parent 61869f7247
commit 6d7f241d3e
2 changed files with 32 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
# 随机点名器 README # 随机点名器 README
> 当前`README.md`以 `点名器 v1.2.3` 为最新版,会与最新版本持续更新。 > 当前`README.md`以 `点名器 v2.0.0.5` 为最新版,会与最新版本持续更新。
## 基本结构 ## 基本结构

View File

@@ -29,14 +29,14 @@ import requests
import os import os
import base64 import base64
version = "v1.2.3" version = "v2.0.0.5"
filename = "./data/names.xls" filename = "./data/names.xls"
configname = "./data/config.data" configname = "./data/config.data"
selname = "./assets/sel.wav" selname = "./assets/sel.wav"
procname = "./assets/proc.wav" procname = "./assets/proc.wav"
iconname = "./assets/点名器.ico" iconname = "./assets/点名器.ico"
gui_size = "550x125" gui_size = "550x140"
appname = '点名器' appname = '点名器'
author = "海Cha" author = "海Cha"
@@ -75,6 +75,18 @@ logging = True
log_level = "INFO" log_level = "INFO"
log_file = "" log_file = ""
class Student(object):
name = ""
subject = ""
id = ""
class_name = ""
def __init__(self,id,class_name,subject,name):
self.id = id
self.class_name = class_name
self.subject = subject
self.name = name
def Decode(str): def Decode(str):
decode = base64.b64decode(str).decode("utf-8") decode = base64.b64decode(str).decode("utf-8")
logs("DEBUG","获得base64解码:" + decode) logs("DEBUG","获得base64解码:" + decode)
@@ -143,22 +155,22 @@ try:
msgbox.showinfo('设置成功',copyright + '\n调试日志已关闭。程序出现预期外动作或崩溃时,请移除此参数以获得日志。\n出现此对话框的原因是由于您在运行本软件时传入了 --disable-logging 参数,欲重启日志记录,请移除该参数。') msgbox.showinfo('设置成功',copyright + '\n调试日志已关闭。程序出现预期外动作或崩溃时,请移除此参数以获得日志。\n出现此对话框的原因是由于您在运行本软件时传入了 --disable-logging 参数,欲重启日志记录,请移除该参数。')
logging = False logging = False
elif arg == "--log-level-DEBUG": elif arg == "--log-level-DEBUG":
msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 DEBUG\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。') msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 DEBUG\n该模式仅供程序运行出现问题排障使用,请勿在常规使用中调用此参数\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。')
log_level = "DEBUG" log_level = "DEBUG"
elif arg == "--log-level-INFO": elif arg == "--log-level-INFO":
msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 INFO\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。') # msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 INFO\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。')
log_level = "INFO" log_level = "INFO"
elif arg == "--log-level-WARN": elif arg == "--log-level-WARN":
msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 WARN\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。') # msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 WARN\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。')
log_level = "WARN" log_level = "WARN"
elif arg == "--log-level-ERROR": elif arg == "--log-level-ERROR":
msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 ERROR\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。') # msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 ERROR\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。')
log_level = "ERROR" log_level = "ERROR"
elif arg == "--log-level-FATAL": elif arg == "--log-level-FATAL":
msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 FATAL\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。') # msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 FATAL\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。')
log_level = "FATAL" log_level = "FATAL"
elif arg == "--log-level-SILENT": elif arg == "--log-level-SILENT":
msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 SILENT\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。') # msgbox.showinfo('设置成功',copyright + '\n调试日志等级更改为 SILENT\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数。')
log_level = "SILENT" log_level = "SILENT"
elif arg.find("--") != -1: elif arg.find("--") != -1:
msgbox.showerror('传参错误','无法识别参数 ' + arg + ' 请调整您的启动参数\n传入 --help以查看帮助信息\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数,欲启动主程序,请移除该参数。') msgbox.showerror('传参错误','无法识别参数 ' + arg + ' 请调整您的启动参数\n传入 --help以查看帮助信息\n出现此对话框的原因是由于您在运行本软件时传入了 ' + arg + ' 参数,欲启动主程序,请移除该参数。')
@@ -171,14 +183,17 @@ finally:
newlog(log_level) newlog(log_level)
if logtype_to_int(log_level) != logtype_to_int("INFO"):
logs("SYSTEM","日志等级调整为" + log_level)
logs("SYSTEM","日志记录已激活")
try: try:
if logtype_to_int(log_level) <= logtype_to_int("DEBUG"): if logtype_to_int(log_level) <= logtype_to_int("DEBUG"):
try: try:
ip = requests.get('http://myip.ipip.net',timeout=5).text.replace('\n', '').replace('\r', '') ip = requests.get('http://myip.ipip.net',timeout=5).text.replace('\n', '').replace('\r', '')
except: except:
ip = "当前IP无公网IP" ip = "当前IP无公网IP"
logs("SYSTEM","日志记录已激活")
logs("DEBUG","-----系统基本信息-----") logs("DEBUG","-----系统基本信息-----")
logs("DEBUG",ip) logs("DEBUG",ip)
logs("DEBUG","运行平台:" + sys.platform) logs("DEBUG","运行平台:" + sys.platform)
@@ -210,18 +225,6 @@ try:
else: else:
sys.exit() sys.exit()
class Student(object):
name = ""
subject = ""
id = ""
class_name = ""
def __init__(self,id,class_name,subject,name):
self.id = id
self.class_name = class_name
self.subject = subject
self.name = name
try: try:
logs("DEBUG","加载数据库文件 " + filename) logs("DEBUG","加载数据库文件 " + filename)
with excel.open_workbook(filename) as excel_data: with excel.open_workbook(filename) as excel_data:
@@ -395,9 +398,9 @@ try:
logs("DEBUG","设置GUI控件样式") logs("DEBUG","设置GUI控件样式")
startramdonStyle=Style() startramdonStyle=Style()
startramdonStyle.configure("SR.TButton", font = ("宋体", 17, "bold"), foreground = "red", background = "white",width=29) startramdonStyle.configure("SR.TButton", font = ("宋体", 17, "bold"), foreground = "red", background = "white",width=29,relief="flat")
setclassStyle=Style() setclassStyle=Style()
setclassStyle.configure("SC.TButton", font = ("宋体", 17), background = "white",height="20",width=13) setclassStyle.configure("SC.TButton", font = ("宋体", 17), background = "white",height="20",width=13,relief="flat")
namelabelStyle=Style() namelabelStyle=Style()
namelabelStyle.configure("NL.TLabel", font = ("宋体", 30, "bold"), background = "white", foreground = "blue",width=15,anchor="center") namelabelStyle.configure("NL.TLabel", font = ("宋体", 30, "bold"), background = "white", foreground = "blue",width=15,anchor="center")
classlabelStyle=Style() classlabelStyle=Style()
@@ -427,10 +430,10 @@ try:
class_label.place(relx=0.3,rely=0.5) class_label.place(relx=0.3,rely=0.5)
subject_label.place(relx=0,rely=0.5) subject_label.place(relx=0,rely=0.5)
name_label.place(relx=0.05,rely=0.05) name_label.place(relx=0.05,rely=0.05)
listbox.place(relx=0.7,rely=0) listbox.place(relx=0.7,rely=0,width=150,height=104)
startrandom.place(relx=0,rely=0.7375) startrandom.place(relx=0,rely=0.7375,height=37)
setclass.place(relx=0.7,rely=0.7375) setclass.place(relx=0.7,rely=0.7375,height=37)
scrool.place(relx=0.965,rely=0) scrool.place(relx=0.965,rely=0,height=104)
if topmost: if topmost:
logs("INFO","应用在置顶模式下运行") logs("INFO","应用在置顶模式下运行")