From b6e0e203f8b6543157ff299da322e171a04ddb61 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 24 Sep 2022 19:54:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=9E=E7=8E=B0=E5=AF=B9?= =?UTF-8?q?=E5=90=BE=E7=88=B1=E4=B8=93=E7=89=88=E7=9A=84=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppStore.py | 3 +- AutoConfig.py | 2 +- InstallDll.py | 2 +- InstallFont.py | 2 +- InstallMsxml.py | 2 +- InstallNetFramework.py | 2 +- InstallOther.py | 2 +- InstallVisualCPlusPlus.py | 2 +- deb/DEBIAN/control | 2 +- deb/opt/apps/deepin-wine-runner/AppStore.py | 2 +- deb/opt/apps/deepin-wine-runner/AutoConfig.py | 2 +- deb/opt/apps/deepin-wine-runner/InstallDll.py | 2 +- .../apps/deepin-wine-runner/InstallFont.py | 2 +- .../apps/deepin-wine-runner/InstallMsxml.py | 2 +- .../deepin-wine-runner/InstallNetFramework.py | 2 +- .../apps/deepin-wine-runner/InstallOther.py | 2 +- .../InstallVisualCPlusPlus.py | 2 +- .../deepin-wine-runner/LANG/InstallDll.py | 2 +- .../deepin-wine-runner/deepin-wine-runner | 2 +- .../deepin-wine-runner-update-bug | 2 +- .../apps/deepin-wine-runner/wine/installwine | 2 +- deepin-wine-runner-update-bug | 2 +- information.json | 2 +- main-newgui.py | 2 +- main-oldgui.py | 2 +- mainwindow.py | 27 ++++++++------ package-script/information.json | 2 +- req/__init__.py | 33 ++++++++++++++++++ req/__pycache__/__init__.cpython-37.pyc | Bin 0 -> 1065 bytes wine/installwine | 2 +- 30 files changed, 77 insertions(+), 38 deletions(-) create mode 100644 req/__init__.py create mode 100644 req/__pycache__/__init__.cpython-37.pyc diff --git a/AppStore.py b/AppStore.py index db583ae..9e8dda8 100755 --- a/AppStore.py +++ b/AppStore.py @@ -14,7 +14,7 @@ import os import sys import json import pyquery -import requests +import req as requests import urllib.parse as parse def CleanTerminal(): @@ -57,6 +57,7 @@ if __name__ == "__main__": try: apiReturn = json.loads(requests.get(f"https://s.pcmgr.qq.com/tapi/web/searchcgi.php?type=search&callback=searchCallback&keyword={parse.quote(search)}&page=1&pernum=30").text[:-2][15:]) except: + #traceback.print_exc() input("无法连接服务器,按回车键继续") CleanTerminal() continue diff --git a/AutoConfig.py b/AutoConfig.py index bbac29e..3402676 100755 --- a/AutoConfig.py +++ b/AutoConfig.py @@ -14,7 +14,7 @@ import os import sys import json import traceback -import requests +import req as requests import PyQt5.QtWidgets as QtWidgets from UI.AutoConfig import * from Model import * diff --git a/InstallDll.py b/InstallDll.py index 3c91b4f..1d07749 100755 --- a/InstallDll.py +++ b/InstallDll.py @@ -14,7 +14,7 @@ import os import sys import json import traceback -import requests +import req as requests def exit(): if __name__ == "__main__": input("按回车键退出") diff --git a/InstallFont.py b/InstallFont.py index 94689ed..73d4808 100755 --- a/InstallFont.py +++ b/InstallFont.py @@ -14,7 +14,7 @@ import os import sys import json import shutil -import requests +import req as requests homePath = os.path.expanduser('~') try: fontList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/fonts/list.json").text) diff --git a/InstallMsxml.py b/InstallMsxml.py index 4893907..040ac4c 100755 --- a/InstallMsxml.py +++ b/InstallMsxml.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests try: msxmlList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/msxml/list.json").text) except: diff --git a/InstallNetFramework.py b/InstallNetFramework.py index 6e606bb..95ce62b 100755 --- a/InstallNetFramework.py +++ b/InstallNetFramework.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests try: netList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/net/list.json").text) except: diff --git a/InstallOther.py b/InstallOther.py index 80615e3..b29ee9c 100755 --- a/InstallOther.py +++ b/InstallOther.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests if "--help" in sys.argv: print("作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢") diff --git a/InstallVisualCPlusPlus.py b/InstallVisualCPlusPlus.py index ccfaa34..de97bc9 100755 --- a/InstallVisualCPlusPlus.py +++ b/InstallVisualCPlusPlus.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests try: netList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/list.json").text) except: diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control index b9bcebc..bbcfd7a 100755 --- a/deb/DEBIAN/control +++ b/deb/DEBIAN/control @@ -1,5 +1,5 @@ Package: spark-deepin-wine-runner -Version: 2.2.0-Alpha3 +Version: 2.2.0-Alpha4 Maintainer: gfdgd xi <3025613752@qq.com>, 为什么您不喜欢熊出没和阿布呢 Homepage: https://gitee.com/gfdgd-xi/deep-wine-runner, https://github.com/gfdgd-xi/deep-wine-runner, https://gitlink.org.cn/gfdgd_xi/deep-wine-runner Architecture: all diff --git a/deb/opt/apps/deepin-wine-runner/AppStore.py b/deb/opt/apps/deepin-wine-runner/AppStore.py index db583ae..0e0465a 100755 --- a/deb/opt/apps/deepin-wine-runner/AppStore.py +++ b/deb/opt/apps/deepin-wine-runner/AppStore.py @@ -14,7 +14,7 @@ import os import sys import json import pyquery -import requests +import req as requests import urllib.parse as parse def CleanTerminal(): diff --git a/deb/opt/apps/deepin-wine-runner/AutoConfig.py b/deb/opt/apps/deepin-wine-runner/AutoConfig.py index bbac29e..3402676 100755 --- a/deb/opt/apps/deepin-wine-runner/AutoConfig.py +++ b/deb/opt/apps/deepin-wine-runner/AutoConfig.py @@ -14,7 +14,7 @@ import os import sys import json import traceback -import requests +import req as requests import PyQt5.QtWidgets as QtWidgets from UI.AutoConfig import * from Model import * diff --git a/deb/opt/apps/deepin-wine-runner/InstallDll.py b/deb/opt/apps/deepin-wine-runner/InstallDll.py index fb99d7d..b66085b 100755 --- a/deb/opt/apps/deepin-wine-runner/InstallDll.py +++ b/deb/opt/apps/deepin-wine-runner/InstallDll.py @@ -14,7 +14,7 @@ import os import sys import json import traceback -import requests +import req as requests def exit(): if __name__ == "__main__": input("按回车键退出") diff --git a/deb/opt/apps/deepin-wine-runner/InstallFont.py b/deb/opt/apps/deepin-wine-runner/InstallFont.py index 94689ed..73d4808 100755 --- a/deb/opt/apps/deepin-wine-runner/InstallFont.py +++ b/deb/opt/apps/deepin-wine-runner/InstallFont.py @@ -14,7 +14,7 @@ import os import sys import json import shutil -import requests +import req as requests homePath = os.path.expanduser('~') try: fontList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/fonts/list.json").text) diff --git a/deb/opt/apps/deepin-wine-runner/InstallMsxml.py b/deb/opt/apps/deepin-wine-runner/InstallMsxml.py index 49998d1..6e17061 100755 --- a/deb/opt/apps/deepin-wine-runner/InstallMsxml.py +++ b/deb/opt/apps/deepin-wine-runner/InstallMsxml.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests try: msxmlList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/msxml/list.json").text) except: diff --git a/deb/opt/apps/deepin-wine-runner/InstallNetFramework.py b/deb/opt/apps/deepin-wine-runner/InstallNetFramework.py index f4a9a8b..e3d6c92 100755 --- a/deb/opt/apps/deepin-wine-runner/InstallNetFramework.py +++ b/deb/opt/apps/deepin-wine-runner/InstallNetFramework.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests try: netList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/net/list.json").text) except: diff --git a/deb/opt/apps/deepin-wine-runner/InstallOther.py b/deb/opt/apps/deepin-wine-runner/InstallOther.py index 79840f2..cb7af1e 100755 --- a/deb/opt/apps/deepin-wine-runner/InstallOther.py +++ b/deb/opt/apps/deepin-wine-runner/InstallOther.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests if "--help" in sys.argv: print("作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢") diff --git a/deb/opt/apps/deepin-wine-runner/InstallVisualCPlusPlus.py b/deb/opt/apps/deepin-wine-runner/InstallVisualCPlusPlus.py index 26a136a..640e5e9 100755 --- a/deb/opt/apps/deepin-wine-runner/InstallVisualCPlusPlus.py +++ b/deb/opt/apps/deepin-wine-runner/InstallVisualCPlusPlus.py @@ -13,7 +13,7 @@ import os import sys import json -import requests +import req as requests try: netList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/list.json").text) except: diff --git a/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py b/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py index fb99d7d..b66085b 100755 --- a/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py +++ b/deb/opt/apps/deepin-wine-runner/LANG/InstallDll.py @@ -14,7 +14,7 @@ import os import sys import json import traceback -import requests +import req as requests def exit(): if __name__ == "__main__": input("按回车键退出") diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner index fb0c99f..a801118 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner @@ -18,7 +18,7 @@ import base64 import shutil import hashlib import platform -import requests +import req as requests import threading import traceback import webbrowser diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner-update-bug b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner-update-bug index c2350d5..1f36530 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner-update-bug +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner-update-bug @@ -3,7 +3,7 @@ import os import sys import json import base64 -import requests +import req as requests import traceback import webbrowser import urllib.parse as parse diff --git a/deb/opt/apps/deepin-wine-runner/wine/installwine b/deb/opt/apps/deepin-wine-runner/wine/installwine index 2dae947..9690184 100755 --- a/deb/opt/apps/deepin-wine-runner/wine/installwine +++ b/deb/opt/apps/deepin-wine-runner/wine/installwine @@ -14,7 +14,7 @@ import shutil import sys import json import traceback -import requests +import req as requests from PyQt5 import QtCore, QtGui, QtWidgets # UI 布局(自动生成) diff --git a/deepin-wine-runner-update-bug b/deepin-wine-runner-update-bug index c2350d5..1f36530 100755 --- a/deepin-wine-runner-update-bug +++ b/deepin-wine-runner-update-bug @@ -3,7 +3,7 @@ import os import sys import json import base64 -import requests +import req as requests import traceback import webbrowser import urllib.parse as parse diff --git a/information.json b/information.json index d9f1194..c5dc3cb 100755 --- a/information.json +++ b/information.json @@ -1,5 +1,5 @@ { - "Version": "2.2.0", + "Version": "2.2.0-Alpha4", "Thank": [ "感谢 @a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301", "感谢 @zhangs https://bbs.deepin.org/post/227948", diff --git a/main-newgui.py b/main-newgui.py index 2fc3bf3..c45a85a 100755 --- a/main-newgui.py +++ b/main-newgui.py @@ -16,7 +16,7 @@ import time import json import shutil import easygui -import requests +import req as requests import threading import traceback import ttkthemes diff --git a/main-oldgui.py b/main-oldgui.py index f7b49ab..b98f85f 100755 --- a/main-oldgui.py +++ b/main-oldgui.py @@ -16,7 +16,7 @@ import time import json import shutil import easygui -import requests +import req as requests import threading import traceback import ttkthemes diff --git a/mainwindow.py b/mainwindow.py index 5d24941..1b31fc1 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -18,11 +18,11 @@ import base64 import shutil import hashlib import platform -import requests import threading import traceback import webbrowser import subprocess +import req as requests import urllib.parse as parse import PyQt5.QtGui as QtGui import PyQt5.QtCore as QtCore @@ -1174,6 +1174,7 @@ class ProgramRunStatusShow(): return if choose == 1: ProgramRunStatusUpload.ShowWindow(sha) + return if choose == 2: try: lists = [0, 0, 0, 0, 0, 0, 0, 0] @@ -1184,8 +1185,7 @@ class ProgramRunStatusShow(): except: traceback.print_exc() QtWidgets.QMessageBox.critical(window, "错误", "无法获取预测数值") - # QtWidgets.QMessageBox.information(None, "提示", "必须选择一个选项!否则无法进入程序!") - # sys.exit() + return informationList = [ @@ -1198,10 +1198,11 @@ class ProgramRunStatusShow(): "含有不良内容,不宜安装", "含有病毒、木马等对计算机有害的软件" ] - - if title.lower() == "null": + try: + if title.lower() == "null": + title = "未知应用" + except: title = "未知应用" - maxHead = lists.index(max(lists)) ProgramRunStatusShow.msgWindow = QtWidgets.QMainWindow() msgWidget = QtWidgets.QWidget() @@ -1594,7 +1595,7 @@ try: canUseWine = [] if os.path.exists("/opt/deepin-box86/box86"): canUseWine.append("基于 box86 的 deepin-wine6-stable") - if not os.path.exists("/opt/exagear/bin/ubt_x64a64_al"): + if os.path.exists("/opt/exagear/bin/ubt_x64a64_al"): canUseWine.append("基于 exagear 的 deepin-wine6-stable") for i in wine.keys(): if not os.system(f"which '{wine[i]}'"): @@ -1708,6 +1709,10 @@ def GetVersion(): fileName = file.read().splitlines() package = False for i in range(0, len(fileName)): + if fileName[i] == "Package: spark-deepin-wine-runner-52": + programVersionType = "吾爱专版" + window.setWindowTitle(f"{title} 吾爱专版") + break if fileName[i] == "Package: spark-deepin-wine-runner": package = True continue @@ -1795,7 +1800,7 @@ updateThingsString = '''※1、Dll 提取工具支持 NT 6.X 及以上版本的 ''' for i in information["Thank"]: thankText += f"{i}\n" -updateTime = "2022年09月11日" +updateTime = "2022年09月22日" about = f'''
一个能让Linux用户更加方便运行Windows应用的程序,内置了对wine图形化的支持和各种Wine工具和自制Wine程序打包器、运行库安装工具等等
同时也内置了基于VirtualBox制作的小白Windows虚拟机安装工具,可以做到只需要用户下载系统镜像并点击安装即可,无需顾及虚拟机安装、创建、虚拟机的分区等等
@@ -1849,8 +1854,6 @@ iconList = [ for i in iconListUnBuild: iconList.append(i) print(iconList) -# 异同步获取信息 -threading.Thread(target=GetVersion).start() ########################### # 窗口创建 @@ -1864,6 +1867,9 @@ if not get_now_lang() == "zh_CN.UTF-8": trans.load(f"{programPath}/LANG/deepin-wine-runner-en_US.qm") app.installTranslator(trans) window = QtWidgets.QMainWindow() +window.setWindowTitle(title) +# 异同步获取信息 +threading.Thread(target=GetVersion).start() widget = QtWidgets.QWidget() window.setCentralWidget(widget) mainLayout = QtWidgets.QGridLayout() @@ -2250,7 +2256,6 @@ hm1_1.triggered.connect(lambda: webbrowser.open_new_tab("https://gitee.com/gfdgd # 窗口设置 window.resize(widget.frameGeometry().width() * 2, widget.frameGeometry().height()) widget.setLayout(mainLayout) -window.setWindowTitle(title) window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg")) widget.show() window.show() diff --git a/package-script/information.json b/package-script/information.json index 9823471..ffc43c4 100755 --- a/package-script/information.json +++ b/package-script/information.json @@ -1,3 +1,3 @@ { - "Version": "2.2.0" + "Version": "2.2.0-Alpha4" } diff --git a/req/__init__.py b/req/__init__.py new file mode 100644 index 0000000..5c75f86 --- /dev/null +++ b/req/__init__.py @@ -0,0 +1,33 @@ +# 此库用于实现 52 版不连接程序服务器 +import req as requests + +unConnect = False +with open("/var/lib/dpkg/status", "r") as i: + unConnect = "Package: spark-deepin-wine-runner-52" in open("/var/lib/dpkg/status", "r").read() +if unConnect: + print("52专版,将会无法连接服务器") + +badUrl = [ + "http://120.25.153.144", + "https://304626p927.goho.co", + "https://30x46269h2.goho.co" +] + +class Respon: + text = "" + +def get(url): # -> requests.Response: + if unConnect: + # 筛选 Url,只有特定的 url 才会被拦截 + for i in badUrl: + if i in url: + raise Exception("52专版不支持连接作者服务器") + return requests.get(url) + +def post(url, data): + if unConnect: + # 筛选 Url,只有特定的 url 才会被拦截 + for i in badUrl: + if i in url: + raise Exception("52专版不支持连接作者服务器") + return requests.post(url, data) \ No newline at end of file diff --git a/req/__pycache__/__init__.cpython-37.pyc b/req/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abc3ed18132f5753446a879569120cb25b1ba391 GIT binary patch literal 1065 zcma)4&ubGw6rP#grkgZrt5y;1p?VMkHruAZXb~y4>aA!+Dhsk~Gh@0W-QCX4Y7Ft9 zsiM;AK}8gi<{;=v!Arq{|HoWyqh9px$v0c0wIKN5ef#FU*?IGQZ%$=0DFk-=Tdwdy zL+F!Qv@8k1BzRZ`poro!vM?nUVH(w_UMCL^S~_iOt=8HasFbkC9PB)gX3-_Y2%lsL zny6!pXgf7%vZz_@XAw=&j%7qU>clc=nr4=fm86}t3%)6eFQ9DqSLldl&QyEMs}48I z?z~BZQqc^BBcf1ZUOjToDU_Tdo9GJzhnM;(V}a}SUvoXy&m+%cJURwPjN~`hAAP=e z_xr}m*1J2K8_%0h*P8F2eEImY`QTOa#p>4m#@4gf)%^=X1QVt?m>D>rv3 zpKX)L$eZ$EUu2PEy#wX&mPZii$EtM+c87 =A8@e_a67z_Xa literal 0 HcmV?d00001 diff --git a/wine/installwine b/wine/installwine index 2dae947..9690184 100755 --- a/wine/installwine +++ b/wine/installwine @@ -14,7 +14,7 @@ import shutil import sys import json import traceback -import requests +import req as requests from PyQt5 import QtCore, QtGui, QtWidgets # UI 布局(自动生成)