From 95106603212c3efc51ab26bf9f34887d4460eedd Mon Sep 17 00:00:00 2001 From: gfdgd xi <3025613752@qq.com> Date: Wed, 9 Feb 2022 11:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A8=8B=E5=BA=8F=E5=BD=A9?= =?UTF-8?q?=E8=9B=8B=E3=80=81=E6=9B=B4=E6=96=B0=E7=AA=97=E5=8F=A3=EF=BC=88=E6=98=A8=E5=A4=A9=E5=BF=98?= =?UTF-8?q?=E8=AE=B0=E4=B8=8A=E4=BC=A0=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- information.json | 2 +- main.py | 63 ++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 15c73be..3a371c9 100755 --- a/README.md +++ b/README.md @@ -267,4 +267,4 @@ pip3 uninstall ttkthemes | WPS Office For Android | https://www.wps.cn/ | | 钉钉 for android | https://page.dingtalk.com/wow/dingtalk/act/download?spm=a3140.8196062.0.0.6f4c5c3dWBhYUM | -### ©2021-2021 \ No newline at end of file +### ©2021-2022 \ No newline at end of file diff --git a/information.json b/information.json index edcfdf3..ab6a395 100755 --- a/information.json +++ b/information.json @@ -3,7 +3,7 @@ "https://gitee.com/gfdgd-xi/uengine-runner", "https://github.com/gfdgd-xi/uengine-runner" ], - "Version": "1.5.3", + "Version": "1.6.0", "System": "Linux(deepin/UOS)", "Tips": [ "更多可见:https://gitee.com/gfdgd-xi/uengine-runner/wikis", diff --git a/main.py b/main.py index a482883..505ca2a 100755 --- a/main.py +++ b/main.py @@ -631,6 +631,41 @@ def GetApkVersion(apkFilePath): line = line.replace(" ", "") 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(): def ShowWindows(): global fullInformation @@ -687,7 +722,7 @@ Activity:{} #message = tk.Toplevel() #message.iconphoto(False, tk.PhotoImage(file=iconPath)) choose = easygui.indexbox(title="选择评分", choices=["含有不良信息", "0分", "1分", "2分", "3分", "4分", "5分", "取消"], msg="""选择应用“{}”的使用评分。建议参考如下规范进行评分: -含有不良信息(-1分):含有色情、暴力、欺凌、赌博等违法违规信息(如果有就不要选择其它选项了) +含有不良信息(-1分):含有违法违规信息(如果有就不要选择其它选项了) 0星:完全无法使用,连安装都有问题 1星:完全无法使用,但是能正常安装 2星:可以打开,但只能使用一点点功能 @@ -716,12 +751,15 @@ Activity:{} return index = numpy.arange(len(data)) 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 matplotlib.pylab.barh(index, data) matplotlib.pylab.yticks(index, ["不良信息", "0分", "1分", "2分", "3分", "4分", "5分"], fontproperties=fonts) matplotlib.pylab.xlabel("用户评分数", fontproperties=fonts) matplotlib.pylab.ylabel("等级", fontproperties=fonts) - matplotlib.pylab.title("“" + GetApkChineseLabel(path) + "”的用户评分(数据只供参考)", fontproperties=fonts) + matplotlib.pylab.title("“" + chinese + "”的用户评分(数据只供参考)", fontproperties=fonts) matplotlib.pylab.show() @@ -1131,12 +1169,32 @@ def showhelp(): def ChgTips(): HelpStr.set(tips) 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) BtnLog = ttk.Button(FrmMenu, text="更新内容",width=14,command=ChgLog) BtnZujian = ttk.Button(FrmMenu, text="程序依赖的组件",width=14,command=ChgDep) BtnGongxian = ttk.Button(FrmMenu, text="有贡献的开发者",width=14,command=ChgCon) BtnAbout = ttk.Button(FrmMenu, text="关于",width=14,command=ChgAbout) + BtnAbout.bind("", Egg) #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"][2], command=UengineRunnerBugUpload) # 设置“程序官网”项 +help.add_command(label="检查更新", command=UpdateWindow.ShowWindow) 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)