修改 新增基础知识梳理 中的一个bug

This commit is contained in:
weiye.wang 2024-04-27 20:36:19 +08:00
parent 2845233ea6
commit 491e35fb57
1 changed files with 2 additions and 1 deletions

View File

@ -20,13 +20,14 @@ class MyWindow_tjjc(QWidget,Ui_Form):
self.pushButton_exec.clicked.connect(self.execstep1) self.pushButton_exec.clicked.connect(self.execstep1)
self.pushButton_commit.clicked.connect(self.commitstep) self.pushButton_commit.clicked.connect(self.commitstep)
self.pushButton_commit.setDisabled(True) self.pushButton_commit.setDisabled(True)
self.mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
def selectfilepath(self): def selectfilepath(self):
self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件",os.getcwd(),"tex文件(*.tex);;所有文件(*)")[0] self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件",os.getcwd(),"tex文件(*.tex);;所有文件(*)")[0]
self.lineEdit_filepath.setText(self.filepath) self.lineEdit_filepath.setText(self.filepath)
self.pushButton_exec.setEnabled(True) self.pushButton_exec.setEnabled(True)
def execstep1(self): def execstep1(self):
self.mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
mycursor = self.mydb.cursor() mycursor = self.mydb.cursor()
mycursor.execute("SELECT bn_id FROM basic_knowledges;") mycursor.execute("SELECT bn_id FROM basic_knowledges;")
bnids = [ret[0] for ret in mycursor.fetchall()] bnids = [ret[0] for ret in mycursor.fetchall()]