32 lines
989 B
Python
32 lines
989 B
Python
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()
|