66 lines
3.2 KiB
Python
66 lines
3.2 KiB
Python
from PySide6.QtWidgets import QMainWindow, QApplication, QFileDialog, QWidget
|
|
from Ui_Qt面板 import *
|
|
from subprocess import call
|
|
from database_tools import *
|
|
import os
|
|
|
|
|
|
def run_command(name,openfilelist):
|
|
configjson = load_dict("文本文件/config.json")
|
|
for f in openfilelist:
|
|
if not f in configjson:
|
|
os.system("code "+f)
|
|
else:
|
|
lineindex = getlineindex(f'"{f}"',"文本文件/config.json")
|
|
os.system(f"code -w -g 文本文件/config.json:{lineindex}")
|
|
call(["python",name+".py"])
|
|
|
|
|
|
|
|
|
|
class MyWindow(QMainWindow,Ui_MainWindow):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setupUi(self)
|
|
self.bind()
|
|
|
|
def bind(self):
|
|
self.action_kxth.triggered.connect(lambda: run_command("寻找空闲题号",[]))
|
|
self.action_xtbd.triggered.connect(lambda: run_command("新题比对",[]))
|
|
self.action_plsl.triggered.connect(lambda: run_command("批量收录题目",[]))
|
|
self.action_tjgl.triggered.connect(lambda: run_command("添加关联题目",[]))
|
|
self.action_tjzd.triggered.connect(lambda: run_command("修改metadata",["文本文件/metadata.txt"]))
|
|
self.action_bjtm.triggered.connect(lambda: run_command("编辑题目信息",[]))
|
|
self.action_xxdr.triggered.connect(lambda: run_command("获取小闲平台使用数据",[]))
|
|
self.action_sddr.triggered.connect(lambda: run_command("手动统计结果导入",["临时文件/手动统计结果.txt"]))
|
|
self.action_tkdr.triggered.connect(lambda: run_command("统考数据导入",["统考数据导入.py"]))
|
|
self.action_dygg.triggered.connect(lambda: run_command("单元挂钩",["单元挂钩.py"]))
|
|
self.action_tqda.triggered.connect(lambda: run_command("文件或剪贴板提取答案",["文件或剪贴板提取答案.py"]))
|
|
self.action_hbsy.triggered.connect(lambda: run_command("合并使用记录并排序",[]))
|
|
self.action_tjjc.triggered.connect(lambda: run_command("添加基础知识梳理",["添加基础知识梳理.py"]))
|
|
self.action_sxth.triggered.connect(lambda: run_command("关键字筛选题号",[]))
|
|
self.action_xtby.triggered.connect(lambda: run_command("多种题目生成",["多种题目生成.py"]))
|
|
self.action_sctp.triggered.connect(lambda: run_command("单一题目转成图片文件",["单一题目转成图片文件.py"]))
|
|
self.action_hqth.triggered.connect(lambda: run_command("在.tex或.pdf文件中获取题号",["在.tex或.pdf文件中获取题号.py"]))
|
|
self.action_jglr.triggered.connect(lambda: run_command("讲义结构编号录入",["讲义结构编号录入.py"]))
|
|
self.action_dtdy.triggered.connect(lambda: run_command("录入答题纸对应信息",["录入答题纸对应信息.py"]))
|
|
self.action_jysc.triggered.connect(lambda: run_command("系列讲义生成",[]))
|
|
self.action_mtpx.triggered.connect(lambda: run_command("mathpix识别文本预处理",[]))
|
|
self.action_dqsz.triggered.connect(lambda: run_command("修改为带圈数字",[]))
|
|
self.action_dxtk.triggered.connect(lambda: run_command("多选题转为填空题",[]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app = QApplication([])
|
|
windows = MyWindow()
|
|
windows.show()
|
|
app.exec()
|
|
|