新增程序彩蛋、更新窗口<初步>(昨天忘记上传了)

This commit is contained in:
gfdgd xi 2022-02-09 11:50:23 +08:00
parent 282bb35444
commit 9510660321
3 changed files with 63 additions and 4 deletions

View File

@ -267,4 +267,4 @@ pip3 uninstall ttkthemes
| WPS Office For Android | https://www.wps.cn/ | | WPS Office For Android | https://www.wps.cn/ |
| 钉钉 for android | https://page.dingtalk.com/wow/dingtalk/act/download?spm=a3140.8196062.0.0.6f4c5c3dWBhYUM | | 钉钉 for android | https://page.dingtalk.com/wow/dingtalk/act/download?spm=a3140.8196062.0.0.6f4c5c3dWBhYUM |
### ©2021-2021 ### ©2021-2022

View File

@ -3,7 +3,7 @@
"https://gitee.com/gfdgd-xi/uengine-runner", "https://gitee.com/gfdgd-xi/uengine-runner",
"https://github.com/gfdgd-xi/uengine-runner" "https://github.com/gfdgd-xi/uengine-runner"
], ],
"Version": "1.5.3", "Version": "1.6.0",
"System": "Linuxdeepin/UOS", "System": "Linuxdeepin/UOS",
"Tips": [ "Tips": [
"更多可见https://gitee.com/gfdgd-xi/uengine-runner/wikis", "更多可见https://gitee.com/gfdgd-xi/uengine-runner/wikis",

63
main.py
View File

@ -631,6 +631,41 @@ def GetApkVersion(apkFilePath):
line = line.replace(" ", "") line = line.replace(" ", "")
return line return line
def VersionCheck(version1, version2):
return version1 == version2
class UpdateWindow():
def ShowWindow():
update = tk.Toplevel()
update.title("检查更新")
versionLabel = ttk.Label(update, text="当前版本:{}\n最新版本:未知\n更新内容:".format(version))
updateText = tk.Text(update)
controlFrame = ttk.Frame(update)
ok = ttk.Button(controlFrame, text="更新", command=UpdateWindow.Update)
cancel = ttk.Button(controlFrame, text="取消", command=update.destroy)
try:
data = json.loads(requests.get("http://120.25.153.144/uengine-runner/update.json").text)
versionLabel = ttk.Label(update, text="当前版本:{}\n最新版本:{}\n更新内容:".format(version, data["Version"]))
if data["Version"] == version:
updateText.insert("0.0", "此为最新版本,无需更新")
ok.configure(state=tk.DISABLED)
else:
updateText.insert("0.0", data["New"])
except:
traceback.print_exc()
messagebox.showerror(title="错误", message="无法连接服务器!")
updateText.configure(state=tk.DISABLED)
versionLabel.pack(anchor=tk.W)
updateText.pack()
controlFrame.pack(anchor=tk.E)
cancel.grid(row=0, column=0)
ok.grid(row=0, column=1)
update.mainloop()
def Update():
os.system("")
class ApkInformation(): class ApkInformation():
def ShowWindows(): def ShowWindows():
global fullInformation global fullInformation
@ -687,7 +722,7 @@ Activity{}
#message = tk.Toplevel() #message = tk.Toplevel()
#message.iconphoto(False, tk.PhotoImage(file=iconPath)) #message.iconphoto(False, tk.PhotoImage(file=iconPath))
choose = easygui.indexbox(title="选择评分", choices=["含有不良信息", "0分", "1分", "2分", "3分", "4分", "5分", "取消"], msg="""选择应用“{}”的使用评分。建议参考如下规范进行评分: choose = easygui.indexbox(title="选择评分", choices=["含有不良信息", "0分", "1分", "2分", "3分", "4分", "5分", "取消"], msg="""选择应用“{}”的使用评分。建议参考如下规范进行评分:
含有不良信息-1含有色情暴力欺凌赌博等违法违规信息如果有就不要选择其它选项了 含有不良信息-1含有违法违规信息如果有就不要选择其它选项了
0完全无法使用连安装都有问题 0完全无法使用连安装都有问题
1完全无法使用但是能正常安装 1完全无法使用但是能正常安装
2可以打开但只能使用一点点功能 2可以打开但只能使用一点点功能
@ -716,12 +751,15 @@ Activity{}
return return
index = numpy.arange(len(data)) index = numpy.arange(len(data))
print(index) print(index)
chinese = GetApkChineseLabel(path)
fig = matplotlib.pylab.figure()
fig.canvas.set_window_title("" + chinese + "”的用户评分(数据只供参考)")
fonts = matplotlib.font_manager.FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc') # 用于支持中文显示需要依赖fonts-noto-cjk fonts = matplotlib.font_manager.FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc') # 用于支持中文显示需要依赖fonts-noto-cjk
matplotlib.pylab.barh(index, data) matplotlib.pylab.barh(index, data)
matplotlib.pylab.yticks(index, ["不良信息", "0分", "1分", "2分", "3分", "4分", "5分"], fontproperties=fonts) matplotlib.pylab.yticks(index, ["不良信息", "0分", "1分", "2分", "3分", "4分", "5分"], fontproperties=fonts)
matplotlib.pylab.xlabel("用户评分数", fontproperties=fonts) matplotlib.pylab.xlabel("用户评分数", fontproperties=fonts)
matplotlib.pylab.ylabel("等级", fontproperties=fonts) matplotlib.pylab.ylabel("等级", fontproperties=fonts)
matplotlib.pylab.title("" + GetApkChineseLabel(path) + "”的用户评分(数据只供参考)", fontproperties=fonts) matplotlib.pylab.title("" + chinese + "”的用户评分(数据只供参考)", fontproperties=fonts)
matplotlib.pylab.show() matplotlib.pylab.show()
@ -1131,12 +1169,32 @@ def showhelp():
def ChgTips(): def ChgTips():
HelpStr.set(tips) HelpStr.set(tips)
LabText.config(wraplength=350) LabText.config(wraplength=350)
def Egg(event):
try:
lists = json.loads(requests.get("http://120.25.153.144/uengine-runner/VersionList.json").text)
data = []
for i in lists:
data.append(int(requests.get("http://120.25.153.144/uengine-runner/{}/data.txt".format(i)).text))
except:
messagebox.showerror(title="错误", message="服务器出错!数据获取失败!")
return
fig = matplotlib.pylab.figure()
fig.canvas.set_window_title("“UEngine 运行器”安装数(数据只供参考)")
matplotlib.pylab.plot(lists, data)
index = numpy.arange(len(lists))
fonts = matplotlib.font_manager.FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc') # 用于支持中文显示需要依赖fonts-noto-cjk
matplotlib.pylab.xlabel("版本号", fontproperties=fonts)
matplotlib.pylab.ylabel("安装数", fontproperties=fonts)
matplotlib.pylab.title("“UEngine 运行器”安装数(数据只供参考)", fontproperties=fonts)
matplotlib.pylab.show()
BtnReadme = ttk.Button(FrmMenu, text="使用说明",width=14,command=ChgTips) BtnReadme = ttk.Button(FrmMenu, text="使用说明",width=14,command=ChgTips)
BtnLog = ttk.Button(FrmMenu, text="更新内容",width=14,command=ChgLog) BtnLog = ttk.Button(FrmMenu, text="更新内容",width=14,command=ChgLog)
BtnZujian = ttk.Button(FrmMenu, text="程序依赖的组件",width=14,command=ChgDep) BtnZujian = ttk.Button(FrmMenu, text="程序依赖的组件",width=14,command=ChgDep)
BtnGongxian = ttk.Button(FrmMenu, text="有贡献的开发者",width=14,command=ChgCon) BtnGongxian = ttk.Button(FrmMenu, text="有贡献的开发者",width=14,command=ChgCon)
BtnAbout = ttk.Button(FrmMenu, text="关于",width=14,command=ChgAbout) BtnAbout = ttk.Button(FrmMenu, text="关于",width=14,command=ChgAbout)
BtnAbout.bind("<Double-Button-1>", Egg)
#layout #layout
@ -1251,6 +1309,7 @@ uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][0], command=OpenProgramURL) # 设置“程序官网”项 help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][0], command=OpenProgramURL) # 设置“程序官网”项
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][2], command=UengineRunnerBugUpload) # 设置“程序官网”项 help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][2], command=UengineRunnerBugUpload) # 设置“程序官网”项
help.add_command(label="检查更新", command=UpdateWindow.ShowWindow)
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][1], command=showhelp) # 设置“关于这个程序”项 help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][1], command=showhelp) # 设置“关于这个程序”项
uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=StartUengine) uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=StartUengine)