kill des connection postgresql
This commit is contained in:
parent
a3479085b6
commit
8c1ee42080
@ -204,6 +204,12 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
cur.execute(SQLAddFav)
|
cur.execute(SQLAddFav)
|
||||||
con.commit()
|
con.commit()
|
||||||
|
else:
|
||||||
|
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||||
|
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||||
|
curSIG.execute(SQLAddFav)
|
||||||
|
conSIG.commit()
|
||||||
|
conSIG.close()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
FAV = "mStarIconAdd.png"
|
FAV = "mStarIconAdd.png"
|
||||||
@ -212,6 +218,12 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
cur.execute(SQLDelFav)
|
cur.execute(SQLDelFav)
|
||||||
con.commit()
|
con.commit()
|
||||||
|
else:
|
||||||
|
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||||
|
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||||
|
curSIG.execute(SQLDelFav)
|
||||||
|
conSIG.commit()
|
||||||
|
conSIG.close()
|
||||||
|
|
||||||
iconFav = QIcon()
|
iconFav = QIcon()
|
||||||
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
||||||
@ -220,6 +232,8 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
||||||
|
|
||||||
def initialisation_flux(self):
|
def initialisation_flux(self):
|
||||||
|
if self.toolButton_2.text() == "1":
|
||||||
|
self.filtre_favorit(None)
|
||||||
self.tableWidget.clear()
|
self.tableWidget.clear()
|
||||||
if NoSignals == 0:
|
if NoSignals == 0:
|
||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
@ -277,15 +291,20 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
for grandsFind in list_grands:
|
for grandsFind in list_grands:
|
||||||
GrandUser.append(grandsFind[0])
|
GrandUser.append(grandsFind[0])
|
||||||
|
|
||||||
if dbtype == sigdb:
|
SQLFavTable = "SELECT concat(schema_name, '.', table_name) FROM admin_sig.favtable WHERE utilisateur LIKE '" + user + "';"
|
||||||
SQLFavTable = "SELECT concat(schema_name, '.', table_name) FROM admin_sig.favtable WHERE utilisateur LIKE '" + user + "';"
|
if dbtype == refdb:
|
||||||
|
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||||
|
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||||
|
curSIG.execute(SQLFavTable)
|
||||||
|
list_fav = curSIG.fetchall()
|
||||||
|
conSIG.close()
|
||||||
|
print('SIG')
|
||||||
|
else:
|
||||||
cur.execute(SQLFavTable)
|
cur.execute(SQLFavTable)
|
||||||
list_fav = cur.fetchall()
|
list_fav = cur.fetchall()
|
||||||
FavList = []
|
FavList = []
|
||||||
for favFind in list_fav:
|
for favFind in list_fav:
|
||||||
FavList.append(favFind[0])
|
FavList.append(favFind[0])
|
||||||
else:
|
|
||||||
FavList = []
|
|
||||||
|
|
||||||
self.tableWidget.setRowCount(len(list_schema))
|
self.tableWidget.setRowCount(len(list_schema))
|
||||||
self.tableWidget.setColumnCount(5)
|
self.tableWidget.setColumnCount(5)
|
||||||
@ -330,8 +349,6 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
||||||
self.FavButton = QPushButton(iconFav, "")
|
self.FavButton = QPushButton(iconFav, "")
|
||||||
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
||||||
if dbtype == refdb:
|
|
||||||
self.FavButton.setEnabled(False)
|
|
||||||
|
|
||||||
if (str(value[0]) + '.' + str(value[1])) in RasterList:
|
if (str(value[0]) + '.' + str(value[1])) in RasterList:
|
||||||
SVG = 'mIconRaster.svg'
|
SVG = 'mIconRaster.svg'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user