Compare commits

...

2 Commits

Author SHA1 Message Date
83fd8fffd4 修复下载量统计脚本因没设置timeout导致dpkg卡住的问题(https://gitee.com/gfdgd-xi/deep-wine-runner/issues/IAGG16)
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Waiting to run
2024-07-30 12:39:02 +08:00
b6f8145fa5 快捷方式工具、wine安装器支持import 2024-07-30 08:26:37 +08:00
5 changed files with 77 additions and 62 deletions

View File

@ -12,6 +12,7 @@
#################
import os
import sys
import globalenv
import traceback
import updatekiller
import PyQt5.QtGui as QtGui
@ -101,7 +102,10 @@ homePath = os.getenv("HOME")
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
#GetDesktopList(f"{homePath}/.local/share/applications")
#print(desktopList)
if (__name__ == "__main__"):
app = QtWidgets.QApplication(sys.argv)
else:
app = globalenv.get_value("app")
window = QtWidgets.QMainWindow()
widget = QtWidgets.QWidget()
layout = QtWidgets.QGridLayout()
@ -118,6 +122,7 @@ window.setCentralWidget(widget)
window.setWindowTitle("图标管理")
window.resize(int(window.frameGeometry().width() * 1.5), int(window.frameGeometry().height() * 1.2))
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
window.show()
GetDesktopThread()
if (__name__ == "__main__"):
window.show()
app.exec_()

View File

@ -10,5 +10,6 @@ with open(f"{programPath}/information.json") as file:
version = json.loads(file.read())["Version"]
print(requests.get(base64.b64decode("aHR0cHM6Ly9zb3VyY2Vmb3JnZS5uZXQvcHJvamVjdHMvZGVlcC13aW5lLXJ1bm5lci13aW5lLWRvd25sb2FkL2ZpbGVzL2Rvd25sb2FkLXRpbWUv").decode("utf-8")
+ version
+ base64.b64decode("L2Rvd25sb2Fk").decode("utf-8")
+ base64.b64decode("L2Rvd25sb2Fk").decode("utf-8"),
timeout=5 # timeout 设置为 5S
).text)

View File

@ -1,3 +1,4 @@
import os
import sys
import globalenv
import PyQt5.QtWidgets as QtWidgets
@ -8,8 +9,10 @@ globalenv._init()
globalenv.set_value("app", app) # 用于将该部分的 app 给子模块的 Qt 控件调用以解决 UI 异常以及其它问题
#import deepin_wine_packager
#modules = __import__("deepin-wine-packager")
modules = __import__("deepin-wine-easy-packager") # 使用该方法可以引入带 - 文件名的模块
#modules = __import__("deepin-wine-easy-packager")
#import mainwindow
window.setCentralWidget(modules.window)
# 使用 __import__ 可以引入带 - 文件名的模块
import wine.installwine
window.setCentralWidget(wine.installwine.window)
window.show()
app.exec_()

View File

@ -21,6 +21,7 @@ import webbrowser
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
sys.path.append(f"{programPath}/../")
from Model import *
import globalenv
from PyQt5 import QtCore, QtGui, QtWidgets
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
# UI 布局(自动生成)
@ -584,7 +585,7 @@ def on_downloadWineFromCloudDisk_clicked():
def get_now_lang()->"获取当前语言":
return os.getenv('LANG')
if __name__ == "__main__":
localJsonList = []
internetJsonList = []
internetWineSourceList = [
@ -595,7 +596,10 @@ if __name__ == "__main__":
"http://127.0.0.1/wine-mirrors/" # 本地测试源
]
if (__name__ == "__main__"):
app = QtWidgets.QApplication(sys.argv)
else:
app = globalenv.get_value("app")
# 读取翻译
if not get_now_lang() == "zh_CN.UTF-8":
trans = QtCore.QTranslator()
@ -608,6 +612,7 @@ if __name__ == "__main__":
ui = Ui_MainWindow()
window.setWindowIcon(QtGui.QIcon(f"{programPath}/../deepin-wine-runner.svg"))
ui.setupUi(window)
if (__name__ == "__main__"):
window.show()
# 隐藏选项
ui.unzip.setVisible(False)
@ -644,5 +649,5 @@ if __name__ == "__main__":
ReadInternetInformation()
# 图标
ui.centralWidget.setWindowIcon(QtGui.QIcon(f"{programPath}/../deepin-wine-runner.svg"))
if (__name__ == "__main__"):
app.exec_()

1
wine/installwine.py Symbolic link
View File

@ -0,0 +1 @@
installwine