mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 02:52:03 +08:00
测试安装包构建
This commit is contained in:
@@ -31,12 +31,15 @@ urlSourcesList = [
|
||||
"https://gitee.com/gfdgd-xi/deep-wine-runner-auto-configuration-script/raw/master/", # Gitee 源
|
||||
"https://gfdgd-xi.github.io/deep-wine-runner-auto-configuration-script/", # Github 源
|
||||
"http://gfdgdxi.msns.cn/wine-runner-list/auto/", # 备用源1,纯 IPv6 源
|
||||
"http://120.25.153.144/deep-wine-runner-auto-configuration-script/", # 备用源2
|
||||
"http://gfdgdxi.free.idcfengye.com/deep-wine-runner-auto-configuration-script/", # 备用源2
|
||||
"http://gfdgdxi.free.idcfengye.com/wine-runner-list/auto/", # 备用源 3
|
||||
"http://127.0.0.1/wine-runner-list/auto/" # 本地测试源
|
||||
]
|
||||
urlSources = urlSourcesList[0]
|
||||
lists = []
|
||||
|
||||
#print(requests.post("http://120.25.153.144:30250/PingLun", {"PinLun": "测试文本", "Version": "purgeexepro.sh"}).text)
|
||||
|
||||
class ProgramRunStatusUpload():
|
||||
msgWindow = None
|
||||
starLayout = None
|
||||
@@ -136,7 +139,7 @@ class InformationWindow():
|
||||
about = f"<h1>关于“{choose}”的介绍</h1>\n<p>暂无此程序的介绍</p>"
|
||||
try:
|
||||
import requests as r
|
||||
fenlists = requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9iYXNoYXBwLw==").decode("utf-8") + fileName + base64.b64decode("L2FsbC5qc29u").decode("utf-8"), timeout=1000).json()
|
||||
fenlists = requests.get(base64.b64decode("aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci1kb3dubG9hZHMtb2YtcnVubmVyL3Jhdy9icmFuY2gvbWFzdGVyL0Jhc2hBcHBGZW4v").decode("utf-8") + fileName + base64.b64decode("L2FsbC5qc29u").decode("utf-8"), timeout=1000).json()
|
||||
tipsInfo = ""
|
||||
except:
|
||||
fenlists = [0, 0, 0, 0, 0]
|
||||
@@ -207,10 +210,36 @@ class InformationWindow():
|
||||
message.show()
|
||||
message.exec_()
|
||||
|
||||
def Add(lists: list):
|
||||
global pinLunLayout
|
||||
pinLunLayout1 = QtWidgets.QVBoxLayout()
|
||||
pinLunLayout = QtWidgets.QWidget()
|
||||
pinLunLayout.setLayout(pinLunLayout1)
|
||||
for i in range(pinLunLayout1.count()):
|
||||
pinLunLayout1.removeItem(pinLunLayout1.itemAt(i))
|
||||
for i in lists:
|
||||
widget = QtWidgets.QWidget()
|
||||
inLayout = QtWidgets.QGridLayout()
|
||||
inLayout.addWidget(QtWidgets.QLabel("<hr>"), 0, 0, 1, 3)
|
||||
inLayout.addWidget(QtWidgets.QLabel(f"<b>{i[0]}</b>"), 1, 0)
|
||||
inLayout.addWidget(QtWidgets.QLabel(f"<p align='right'><b>第{i[1]}层</b></p>"), 1, 2)
|
||||
inLayout.addWidget(QtWidgets.QLabel(i[2]), 2, 0, 1, 3)
|
||||
widget.setLayout(inLayout)
|
||||
pinLunLayout1.addWidget(widget)
|
||||
#pinLunLayout.addWidget(QtWidgets.QLabel("<hr/>"))
|
||||
# pinLunLayout = widget
|
||||
|
||||
all = 0
|
||||
now = 0
|
||||
class ProgramRunStatusShow():
|
||||
msgWindow = None
|
||||
pingLunLayout = None
|
||||
def ShowWindow():
|
||||
global lists
|
||||
global all
|
||||
global now
|
||||
global leftButton
|
||||
global rightButton
|
||||
# 获取选中项
|
||||
try:
|
||||
choose = ui.searchList.selectionModel().selectedIndexes()[0].data()
|
||||
@@ -224,15 +253,12 @@ class ProgramRunStatusShow():
|
||||
fileName = i[1]
|
||||
break
|
||||
try:
|
||||
fenlists = requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9iYXNoYXBwLw==").decode("utf-8") + fileName + base64.b64decode("L2FsbC5qc29u").decode("utf-8")).json()
|
||||
#r = requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9hcHAv").decode("utf-8") + sha + base64.b64decode("L3RpdGxlLnR4dA==").decode("utf-8"))
|
||||
#r.encoding = "utf-8"
|
||||
#title = r.text
|
||||
fenlists = requests.get(base64.b64decode("aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci1kb3dubG9hZHMtb2YtcnVubmVyL3Jhdy9icmFuY2gvbWFzdGVyL0Jhc2hBcHBGZW4v").decode("utf-8") + fileName + base64.b64decode("L2FsbC5qc29u").decode("utf-8")).json()
|
||||
tipsInfo = ""
|
||||
except:
|
||||
#traceback.print_exc()
|
||||
fenlists = [0, 0, 0, 0, 0]
|
||||
tipsInfo = "暂时无人提交此脚本运行情况,是否立即提交?"
|
||||
tipsInfo = "暂时无人提交此脚本评分,是否立即提交?"
|
||||
|
||||
maxHead = fenlists.index(max(fenlists))
|
||||
allNumber = 0
|
||||
@@ -248,13 +274,13 @@ class ProgramRunStatusShow():
|
||||
msgWidget = QtWidgets.QWidget()
|
||||
msgWidgetLayout = QtWidgets.QGridLayout()
|
||||
starLayout = QtWidgets.QHBoxLayout()
|
||||
uploadButton = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "点此上传运行情况"))
|
||||
uploadButton = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "点此提交评分"))
|
||||
uploadButton.clicked.connect(lambda: ProgramRunStatusUpload.ShowWindow(fileName, choose))
|
||||
msgWidgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "综合评价:")), 0, 0)
|
||||
msgWidgetLayout.addLayout(starLayout, 0, 1)
|
||||
msgWidgetLayout.addWidget(QtWidgets.QLabel(tipsInfo), 1, 0, 1, 2)
|
||||
msgWidgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "综合评价:")), 0, 0, 2, 1)
|
||||
msgWidgetLayout.addLayout(starLayout, 0, 1, 2, 1)
|
||||
msgWidgetLayout.addWidget(QtWidgets.QLabel(tipsInfo), 0, 2)
|
||||
#msgWidgetLayout.addWidget(QtWidgets.QLabel("" if dateVersion == "" else f"数据版本:{dateVersion}"), 2, 0, 1, 2)
|
||||
msgWidgetLayout.addWidget(uploadButton, 3, 0, 1, 2)
|
||||
msgWidgetLayout.addWidget(uploadButton, 1, 2)
|
||||
end = 5
|
||||
if maxHead > 5:
|
||||
for i in range(end):
|
||||
@@ -265,12 +291,136 @@ class ProgramRunStatusShow():
|
||||
head = maxHead
|
||||
for i in range(head, end):
|
||||
starLayout.addWidget(QtWidgets.QLabel(f"<img src='{programPath}/Icon/UnStar.svg' width=50>"))
|
||||
pingLun = QtWidgets.QWidget()
|
||||
msgWidgetLayout.addWidget(pingLun, 4, 0, 1, 3)
|
||||
pingLunLayout = QtWidgets.QGridLayout()
|
||||
pingLunInfo = QtWidgets.QTextEdit()
|
||||
#pingLunInfo.document().setMaximumBlockCount(5)
|
||||
uploadButton = QtWidgets.QPushButton("评论")
|
||||
pingLunLayout.addWidget(pingLunInfo, 0, 0, 1, 3)
|
||||
pingLunLayout.addWidget(uploadButton, 1, 2)
|
||||
pingLunInfo.setPlaceholderText("""在此输入评论,须知:
|
||||
※1、不得含有色情、暴力、侮辱等违法内容
|
||||
※2、不得有广告推广等内容
|
||||
※3、字数至少 15 字,但不得超过 250 字
|
||||
※4、评论内容最多 5 行,且评论内容将会进行审核,意味着评论不会实时生效显示""")
|
||||
leftButton = QtWidgets.QPushButton("上一页")
|
||||
rightButton = QtWidgets.QPushButton("下一页")
|
||||
if maxHead == 0:
|
||||
#pingLun.setDisabled(True)
|
||||
pass
|
||||
else:
|
||||
# 显示最新的3条评论
|
||||
try:
|
||||
all = int(requests.get(f"{base64.b64decode('aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy9iYXNocGlubHVuL3Jhdy9icmFuY2gvbWFzdGVyLw==').decode('utf-8')}{fileName}/data.txt").text)
|
||||
now = all - 3
|
||||
print(all)
|
||||
if all < 3:
|
||||
start = 0
|
||||
rightButton.setDisabled(True)
|
||||
else:
|
||||
start = all - 3
|
||||
uploadList = []
|
||||
for i in range(all - 1, start - 1, -1):
|
||||
print(f"第 {i + 1} 条评论:")
|
||||
info = requests.get(f"{base64.b64decode('aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy9iYXNocGlubHVuL3Jhdy9icmFuY2gvbWFzdGVyLw==').decode('utf-8')}{fileName}/pf-{i}.txt").text.strip()
|
||||
print(info)
|
||||
uploadList.append([f"用户{i + 1}", i + 1, info])
|
||||
Add(uploadList)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
try:
|
||||
ProgramRunStatusShow.pingLunLayout = pingLunLayout
|
||||
pingLunLayout.addWidget(pinLunLayout, 2, 0, 1, 3)
|
||||
except:
|
||||
leftButton.setDisabled(True)
|
||||
rightButton.setDisabled(True)
|
||||
leftButton.clicked.connect(Left)
|
||||
rightButton.clicked.connect(Right)
|
||||
pingLunLayout.addWidget(leftButton, 3, 0)
|
||||
pingLunLayout.addWidget(rightButton, 3, 2)
|
||||
leftButton.setDisabled(True)
|
||||
pingLun.setLayout(pingLunLayout)
|
||||
msgWidget.setLayout(msgWidgetLayout)
|
||||
uploadButton.clicked.connect(lambda: ProgramRunStatusShow.Upload(pingLunInfo.toPlainText(), fileName))
|
||||
ProgramRunStatusShow.msgWindow.setCentralWidget(msgWidget)
|
||||
ProgramRunStatusShow.msgWindow.setWindowIcon(QtGui.QIcon(iconPath))
|
||||
ProgramRunStatusShow.msgWindow.setWindowTitle(f"脚本“{choose}”运行情况")
|
||||
ProgramRunStatusShow.msgWindow.show()
|
||||
|
||||
def Upload(info, name):
|
||||
print(f"脚本:{name}")
|
||||
print(f"评论:{info}")
|
||||
try:
|
||||
#
|
||||
res = requests.post(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0OjMwMjUwL1BpbmdMdW4=").decode("utf-8"), {"PinLun": info, "Version": name}).json()
|
||||
print(res)
|
||||
if res["ExitCode"]:
|
||||
QtWidgets.QMessageBox.critical(ProgramRunStatusShow.msgWindow, "错误", res["Error"])
|
||||
return
|
||||
QtWidgets.QMessageBox.information(ProgramRunStatusShow.msgWindow, "提示", res["Error"])
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(ProgramRunStatusShow.msgWindow, "错误", "提交失败")
|
||||
|
||||
|
||||
def UpdateFen():
|
||||
global now
|
||||
fileName = ""
|
||||
# 获取选中项
|
||||
try:
|
||||
choose = ui.searchList.selectionModel().selectedIndexes()[0].data()
|
||||
except:
|
||||
QtWidgets.QMessageBox.critical(window, "错误", "您未选择任何配置文件")
|
||||
return
|
||||
for i in lists:
|
||||
print(i)
|
||||
if i[0] == choose:
|
||||
fileName = i[1]
|
||||
break
|
||||
uploadList = []
|
||||
for i in range(now + 2, now - 1, -1):
|
||||
print(f"第 {i + 1} 条评论:")
|
||||
info = requests.get(f"https://code.gitlink.org.cn/gfdgd-xi-org/bashpinlun/raw/branch/master/{fileName}/pf-{i}.txt").text.strip()
|
||||
print(info)
|
||||
uploadList.append([f"用户{i + 1}", i + 1, info])
|
||||
#ProgramRunStatusShow.pingLunLayout.removeItem(ProgramRunStatusShow.pingLunLayout.itemAt(2))
|
||||
ProgramRunStatusShow.pingLunLayout.removeWidget(pinLunLayout)
|
||||
pinLunLayout.hide()
|
||||
#pinLunLayout.
|
||||
Add(uploadList)
|
||||
#l = QtWidgets.QGridLayout()
|
||||
#l.removeWidget(pinLunLayout)
|
||||
ProgramRunStatusShow.pingLunLayout.addWidget(pinLunLayout, 2, 0, 1, 3)
|
||||
|
||||
def Left():
|
||||
global now
|
||||
global all
|
||||
|
||||
if now + 6 >= all:
|
||||
now = all - 3
|
||||
leftButton.setDisabled(True)
|
||||
rightButton.setEnabled(True)
|
||||
else:
|
||||
now += 3
|
||||
leftButton.setEnabled(True)
|
||||
rightButton.setEnabled(True)
|
||||
UpdateFen()
|
||||
print(all)
|
||||
print(now)
|
||||
|
||||
def Right():
|
||||
global now
|
||||
if now - 3 < 0:
|
||||
now = 0
|
||||
rightButton.setDisabled(True)
|
||||
leftButton.setEnabled(True)
|
||||
else:
|
||||
now -= 3
|
||||
leftButton.setEnabled(True)
|
||||
rightButton.setEnabled(True)
|
||||
UpdateFen()
|
||||
|
||||
def UploadFen():
|
||||
global lists
|
||||
# 获取选中项
|
||||
@@ -401,6 +551,7 @@ if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
window = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
pinLunLayout = QtWidgets.QHBoxLayout()
|
||||
ui.setupUi(window)
|
||||
window.setWindowTitle(f"Wine 运行器 {version}——容器自动配置部署脚本")
|
||||
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
|
||||
|
||||
Reference in New Issue
Block a user