迁移 共享使用记录
This commit is contained in:
parent
96dabd521b
commit
9e33772912
|
|
@ -0,0 +1,41 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## Form generated from reading UI file '共享使用记录.ui'
|
||||||
|
##
|
||||||
|
## Created by: Qt User Interface Compiler version 6.6.2
|
||||||
|
##
|
||||||
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||||
|
QMetaObject, QObject, QPoint, QRect,
|
||||||
|
QSize, QTime, QUrl, Qt)
|
||||||
|
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||||
|
QFont, QFontDatabase, QGradient, QIcon,
|
||||||
|
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||||
|
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||||
|
from PySide6.QtWidgets import (QApplication, QPushButton, QSizePolicy, QWidget)
|
||||||
|
|
||||||
|
class Ui_Form(object):
|
||||||
|
def setupUi(self, Form):
|
||||||
|
if not Form.objectName():
|
||||||
|
Form.setObjectName(u"Form")
|
||||||
|
Form.resize(760, 490)
|
||||||
|
self.pushButton_exec = QPushButton(Form)
|
||||||
|
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||||
|
self.pushButton_exec.setGeometry(QRect(270, 170, 251, 131))
|
||||||
|
font = QFont()
|
||||||
|
font.setBold(True)
|
||||||
|
self.pushButton_exec.setFont(font)
|
||||||
|
|
||||||
|
self.retranslateUi(Form)
|
||||||
|
|
||||||
|
QMetaObject.connectSlotsByName(Form)
|
||||||
|
# setupUi
|
||||||
|
|
||||||
|
def retranslateUi(self, Form):
|
||||||
|
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u5171\u4eab\u4f7f\u7528\u8bb0\u5f55", None))
|
||||||
|
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u76f8\u540c\u9898\u76ee\u5171\u4eab\u4f7f\u7528\u8bb0\u5f55", None))
|
||||||
|
# retranslateUi
|
||||||
|
|
||||||
|
|
@ -16,6 +16,7 @@ from 添加关联题目 import MyWindow_tjgl
|
||||||
from 批量收录新题 import MyWindow_bdsl
|
from 批量收录新题 import MyWindow_bdsl
|
||||||
from 下载小闲答题数据 import MyWindow_xxxz
|
from 下载小闲答题数据 import MyWindow_xxxz
|
||||||
from 新增基础知识梳理 import MyWindow_tjjc
|
from 新增基础知识梳理 import MyWindow_tjjc
|
||||||
|
from 共享使用记录 import MyWindow_gxsy
|
||||||
from database_tools_2 import *
|
from database_tools_2 import *
|
||||||
|
|
||||||
class MyWindow(QMainWindow,Ui_MainWindow):
|
class MyWindow(QMainWindow,Ui_MainWindow):
|
||||||
|
|
@ -43,10 +44,13 @@ class MyWindow(QMainWindow,Ui_MainWindow):
|
||||||
self.tjgl = MyWindow_tjgl(self.database)
|
self.tjgl = MyWindow_tjgl(self.database)
|
||||||
self.layout_tjgl.addWidget(self.tjgl) #以上三行为初始化“添加关联”tab
|
self.layout_tjgl.addWidget(self.tjgl) #以上三行为初始化“添加关联”tab
|
||||||
|
|
||||||
|
self.layout_gxsy = QVBoxLayout(self.tab_gxsy)
|
||||||
|
self.gxsy = MyWindow_gxsy(self.database)
|
||||||
|
self.layout_gxsy.addWidget(self.gxsy) #以上三行为初始化“新增基础知识梳理”tab
|
||||||
|
|
||||||
self.layout_tjjc = QVBoxLayout(self.tab_tjjc)
|
self.layout_tjjc = QVBoxLayout(self.tab_tjjc)
|
||||||
self.tjjc = MyWindow_tjjc(self.database)
|
self.tjjc = MyWindow_tjjc(self.database)
|
||||||
self.layout_tjjc.addWidget(self.tjjc) #以上三行为初始化“小闲下载”tab
|
self.layout_tjjc.addWidget(self.tjjc) #以上三行为初始化“新增基础知识梳理”tab
|
||||||
|
|
||||||
self.layout_xxxz = QVBoxLayout(self.tab_xxxz)
|
self.layout_xxxz = QVBoxLayout(self.tab_xxxz)
|
||||||
self.xxxz = MyWindow_xxxz()
|
self.xxxz = MyWindow_xxxz()
|
||||||
|
|
@ -103,7 +107,8 @@ class MyWindow(QMainWindow,Ui_MainWindow):
|
||||||
self.sxth.setdbname,
|
self.sxth.setdbname,
|
||||||
self.tjgl.setdbname,
|
self.tjgl.setdbname,
|
||||||
self.bdsl.setdbname,
|
self.bdsl.setdbname,
|
||||||
self.tjjc.setdbname
|
self.tjjc.setdbname,
|
||||||
|
self.gxsy.setdbname
|
||||||
]: #在列表中的tab里传送数据库名的连接
|
]: #在列表中的tab里传送数据库名的连接
|
||||||
self.sendDBname.connect(func)
|
self.sendDBname.connect(func)
|
||||||
def sendValue(self):
|
def sendValue(self):
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||||
|
from Ui_共享使用记录 import Ui_Form
|
||||||
|
from database_tools_2 import *
|
||||||
|
|
||||||
|
class MyWindow_gxsy(QWidget,Ui_Form):
|
||||||
|
def __init__(self,database_name):
|
||||||
|
super().__init__()
|
||||||
|
self.database_name = database_name
|
||||||
|
self.setupUi(self)
|
||||||
|
self.bind()
|
||||||
|
|
||||||
|
def setdbname(self,string):
|
||||||
|
self.database_name = string
|
||||||
|
# print(self.database_name)
|
||||||
|
|
||||||
|
def bind(self):
|
||||||
|
self.pushButton_exec.clicked.connect(self.exec)
|
||||||
|
|
||||||
|
def exec(self):
|
||||||
|
same_list = generate_same_list(self.database_name)
|
||||||
|
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||||
|
for id,same_id in tqdm.tqdm(same_list):
|
||||||
|
ShareSameUsagesinDB(id,same_id,mydb)
|
||||||
|
mydb.commit()
|
||||||
|
mydb.close()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app = QApplication([])
|
||||||
|
windows = MyWindow_gxsy("tikutest")
|
||||||
|
windows.show()
|
||||||
|
app.exec()
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Form</class>
|
||||||
|
<widget class="QWidget" name="Form">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>760</width>
|
||||||
|
<height>490</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>共享使用记录</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="pushButton_exec">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>270</x>
|
||||||
|
<y>170</y>
|
||||||
|
<width>251</width>
|
||||||
|
<height>131</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>相同题目共享使用记录</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue