新增命令与帮助

This commit is contained in:
gfdgd xi 2023-01-04 13:35:31 +08:00
parent d46c83f51b
commit 9cf0c16697
12 changed files with 62 additions and 31 deletions

14
AutoShell/command/installmsi Executable file

@ -0,0 +1,14 @@
#!/usr/bin/env python3
# 加入路径
import os
import sys
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
sys.path.append(f"{programPath}/../../")
import ConfigLanguareRunner
# 符号转移
argv = []
for i in sys.argv[1:]:
argv.append(i.replace(" ", "\\ "))
com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}")
com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE"))
sys.exit(int(ConfigLanguareRunner.programEnv[9][1]))

14
AutoShell/command/programforum Executable file

@ -0,0 +1,14 @@
#!/usr/bin/env python3
# 加入路径
import os
import sys
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
sys.path.append(f"{programPath}/../../")
import ConfigLanguareRunner
# 符号转移
argv = []
for i in sys.argv[1:]:
argv.append(i.replace(" ", "\\ "))
com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}")
com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE"))
sys.exit(int(ConfigLanguareRunner.programEnv[9][1]))

@ -38,5 +38,9 @@
"control": "打开控制面板\n参数数量0\n参数介绍无",
"taskmgr": "打开任务管理器\n参数数量0\n参数介绍无",
"killallwineserver": "杀死所有 Wine 程序\n参数数量0\n参数介绍无",
"installvb": "安装指定的 VB 运行库到指定容器\n参数数量1\n参数介绍在安装 Visual Basic Runtime 工具的编号,如 4 Visual Basic Runtime Visual Basic 6"
"installvb": "安装指定的 VB 运行库到指定容器\n参数数量1\n参数介绍在安装 Visual Basic Runtime 工具的编号,如 4 Visual Basic Runtime Visual Basic 6",
"installother": "安装未归类的运行库到指定容器\n参数数量1\n参数介绍在安装其它运行库工具的编号如 2 MFC运行库",
"decompressionbottle": "解压用 wine 打包的 deb 包内的容器到指定路径\n参数数量2\n参数介绍deb 包路径+要解压到的路径",
"programforum": "打开程序论坛\n参数数量0\n参数介绍无",
"installmsi": "安装 MSI 文件到指定容器\n参数数量1\n参数介绍msi 文件路径"
}

@ -128,7 +128,8 @@ class Command():
"installvb",
"installother",
"decompressionbottle",
"programforum"
"programforum",
"installmsi"
]
def __init__(self, commandString: str) -> None:
@ -435,6 +436,10 @@ class Command():
def ProgramForum(self):
webbrowser.open_new_tab("https://gfdgdxi.flarum.cloud/")
def InstallMSI(self):
self.command = ["bat", "msiexec", "/i", self.command[1]]
return self.Bat()
# 可以运行的命令的映射关系
# 可以被使用的命令的映射
commandList = {
@ -479,7 +484,8 @@ class Command():
"installvb": InstallVB,
"installother": InstallOther,
"decompressionbottle": DecompressionBottle,
"programforum": ProgramForum
"programforum": ProgramForum,
"installmsi": InstallMSI
}
# 参数数列表
@ -526,7 +532,8 @@ class Command():
"installvb": [1],
"installother": [1],
"decompressionbottle": [2],
"programforum": [0]
"programforum": [0],
"installmsi": [1]
}
windowsUnrun = [
"createbotton",

@ -15,6 +15,7 @@ import sys
import base64
import json
import traceback
import urllib.request
import req as requests
import PyQt5.QtWidgets as QtWidgets
from UI.AutoConfig import *
@ -38,8 +39,6 @@ urlSourcesList = [
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
@ -139,7 +138,7 @@ class InformationWindow():
about = f"<h1>关于“{choose}”的介绍</h1>\n<p>暂无此程序的介绍</p>"
try:
import requests as r
fenlists = requests.get(base64.b64decode("aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci1kb3dubG9hZHMtb2YtcnVubmVyL3Jhdy9icmFuY2gvbWFzdGVyL0Jhc2hBcHBGZW4v").decode("utf-8") + fileName + base64.b64decode("L2FsbC5qc29u").decode("utf-8"), timeout=1000).json()
fenlists = requests.get(base64.b64decode("aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci1kb3dubG9hZHMtb2YtcnVubmVyL3Jhdy9icmFuY2gvbWFzdGVyL0Jhc2hBcHBGZW4v").decode("utf-8") + urllib.request.quote(fileName) + base64.b64decode("L2FsbC5qc29u").decode("utf-8"), timeout=1000).json()
tipsInfo = ""
except:
fenlists = [0, 0, 0, 0, 0]
@ -253,7 +252,7 @@ class ProgramRunStatusShow():
fileName = i[1]
break
try:
fenlists = requests.get(base64.b64decode("aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci1kb3dubG9hZHMtb2YtcnVubmVyL3Jhdy9icmFuY2gvbWFzdGVyL0Jhc2hBcHBGZW4v").decode("utf-8") + fileName + base64.b64decode("L2FsbC5qc29u").decode("utf-8")).json()
fenlists = requests.get(base64.b64decode("aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci1kb3dubG9hZHMtb2YtcnVubmVyL3Jhdy9icmFuY2gvbWFzdGVyL0Jhc2hBcHBGZW4v").decode("utf-8") + urllib.request.quote(fileName) + base64.b64decode("L2FsbC5qc29u").decode("utf-8")).json()
tipsInfo = ""
except:
#traceback.print_exc()
@ -311,7 +310,7 @@ class ProgramRunStatusShow():
else:
# 显示最新的3条评论
try:
all = int(requests.get(f"{base64.b64decode('aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy9iYXNocGlubHVuL3Jhdy9icmFuY2gvbWFzdGVyLw==').decode('utf-8')}{fileName}/data.txt").text)
all = int(requests.get(f"{base64.b64decode('aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy9iYXNocGlubHVuL3Jhdy9icmFuY2gvbWFzdGVyLw==').decode('utf-8')}{urllib.request.quote(fileName)}/data.txt").text)
now = all - 3
print(all)
if all < 3:
@ -322,7 +321,7 @@ class ProgramRunStatusShow():
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()
info = requests.get(f"{base64.b64decode('aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy9iYXNocGlubHVuL3Jhdy9icmFuY2gvbWFzdGVyLw==').decode('utf-8')}{urllib.request.quote(fileName)}/pf-{i}.txt").text.strip()
print(info)
uploadList.append([f"用户{i + 1}", i + 1, info])
Add(uploadList)
@ -380,7 +379,7 @@ def UpdateFen():
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()
info = requests.get(f"https://code.gitlink.org.cn/gfdgd-xi-org/bashpinlun/raw/branch/master/{urllib.request.quote(fileName)}/pf-{i}.txt").text.strip()
print(info)
uploadList.append([f"用户{i + 1}", i + 1, info])
#ProgramRunStatusShow.pingLunLayout.removeItem(ProgramRunStatusShow.pingLunLayout.itemAt(2))
@ -572,7 +571,7 @@ if __name__ == "__main__":
#pass
# 连接信号和槽
ui.saerchBotton.clicked.connect(Connect.SearchBotton_Clicked)
ui.uploadFen.clicked.connect(UploadFen)
#ui.uploadFen.clicked.connect(UploadFen)
ui.getInfoButton.clicked.connect(InformationWindow.ShowWindow)
ui.runBotton.clicked.connect(Connect.RunBotton_Clicked)
ui.openFile.triggered.connect(Connect.OpenFile_Triggered)

@ -41,9 +41,6 @@ class Ui_MainWindow(object):
self.getFen = QtWidgets.QPushButton(self.centralwidget)
self.getFen.setObjectName("getFen")
self.horizontalLayout_2.addWidget(self.getFen)
self.uploadFen = QtWidgets.QPushButton(self.centralwidget)
self.uploadFen.setObjectName("uploadFen")
self.horizontalLayout_2.addWidget(self.uploadFen)
self.runBotton = QtWidgets.QPushButton(self.centralwidget)
self.runBotton.setObjectName("runBotton")
self.horizontalLayout_2.addWidget(self.runBotton)
@ -110,8 +107,7 @@ class Ui_MainWindow(object):
self.searchTips.setText(_translate("MainWindow", "搜索内容(为空代表显示所有内容):"))
self.saerchBotton.setText(_translate("MainWindow", "搜索"))
self.getInfoButton.setText(_translate("MainWindow", "获取选中项介绍"))
self.getFen.setText(_translate("MainWindow", "获取选中项的评分"))
self.uploadFen.setText(_translate("MainWindow", "提交选中项的评分"))
self.getFen.setText(_translate("MainWindow", "获取/提交选中项的评分和评论"))
self.runBotton.setText(_translate("MainWindow", "部署此方案"))
self.menu.setTitle(_translate("MainWindow", "程序"))
self.menu_2.setTitle(_translate("MainWindow", "切换源"))

@ -64,14 +64,7 @@
<item>
<widget class="QPushButton" name="getFen">
<property name="text">
<string>获取选中项的评分</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="uploadFen">
<property name="text">
<string>提交选中项的评分</string>
<string>获取/提交选中项的评分和评论</string>
</property>
</widget>
</item>

@ -1852,7 +1852,7 @@ def UploadLog():
"Log": returnText.toPlainText(),
"Wine": wine[o1.currentText()],
"Tips": text
}).json
}).json()
if returnList["ExitCode"] == 0:
QtWidgets.QMessageBox.information(window, "提示", "上传成功!")
else:
@ -2343,7 +2343,8 @@ exe路径\' 参数 \'
updateThingsString = transla.transe("U", '''※1、不基于生态适配脚本打包器支持禁用 Mono/Gecko 打包器;
※2、自动容器配置脚本新增命令 decompressionbottle、programforum新增评论功能
※3、安装 Windows 虚拟机功能更换应答镜像图标并添加常用 Windows 组件安装功能;
※4、安装 Windows 虚拟机功能提供镜像下载的网盘链接。
※4、安装 Windows 虚拟机功能提供镜像下载的网盘链接;
※5、修复提交日志功能在提交成功时依旧提示提交失败问题。
''')
for i in information["Thank"]:
thankText += f"{i}\n"

@ -1852,7 +1852,7 @@ def UploadLog():
"Log": returnText.toPlainText(),
"Wine": wine[o1.currentText()],
"Tips": text
}).json
}).json()
if returnList["ExitCode"] == 0:
QtWidgets.QMessageBox.information(window, "提示", "上传成功!")
else:
@ -2341,9 +2341,12 @@ exe路径\' 参数 \'
以及此脚本安装的 Wine 无法保证 100% 能使用以及副作用是会提示
<code>N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构跳过配置文件 'main/binary-i386/Packages' 的获取</code>''')
updateThingsString = transla.transe("U", '''※1、不基于生态适配脚本打包器支持禁用 Mono/Gecko 打包器;
2自动容器配置脚本新增命令 decompressionbottleprogramforum新增评论功能
3安装 Windows 虚拟机功能更换应答镜像图标并添加常用 Windows 组件安装功能
4安装 Windows 虚拟机功能提供镜像下载的网盘链接
2自动容器配置脚本新增命令 decompressionbottleprogramforuminstallmsi 以及上述命令的帮助
3自动容器配置脚本新增评论功能
4自动容器配置脚本新增许多应用安装脚本
5安装 Windows 虚拟机功能更换应答镜像图标并添加常用 Windows 组件安装功能
6安装 Windows 虚拟机功能提供镜像下载的网盘链接
7修复提交日志功能在提交成功时依旧提示提交失败问题
''')
for i in information["Thank"]:
thankText += f"{i}\n"

Binary file not shown.