Commit a90da4d9 authored by Babacar Thiam's avatar Babacar Thiam

update data create and chargement

parents
chargementSGDEexcelsans btl Version 1.2 installation guide
1- Installation on Linux/Unix
To install the sGDE_IsmerQO package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
sGDE_IsmerQO package from the gitlasso
The package for Linux/Unix comes
as a gzip tar file. To install, follow these steps:
1- tar zxvf sGDE_IsmerQO-1.2.tar.gz
(or gunzip -c sGDE_IsmerQO-1.2.tar.gz | tar xvf -)
2- cd sGDE_IsmerQO-1.2/src
3- su - root (become superuser)
4- python setup.py install
And sGDE_IsmerQO should now be
available for execution.
2- Installation of the source code on Windows
To install the sGDE_IsmerQO package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
sGDE_IsmerQO package from the gitlasso
The package for windows comes Windows comes as a zip file.
To install, follow these steps:
1- Download the zip file to a directory such as c:\temp
2- Unzip sGDE_IsmerQO-1.2.zip
3- Open a command window
4- cd c:\temp\sGDE_IsmerQO-1.2\src
5- python setup.py install
sGDE_IsmerQO.py should now be
available for execution and will have been copied to the Scripts directory of your Python
installation (e.g., c:\Python24\Scripts). In order to use
the sGDE_IsmerQO.py package from anywhere on your machine, you must
add this directory to your PATH environnement variable.
#
#Makefile pour construire les paquets de
#distribution de odf2netcdf
all:
python setup.py sdist --formats=gztar,zip
python setup.py bdist_wininst
chargementSGDEexcelsans btl Version 1.2 installation guide
1- Installation on Linux/Unix
To install the sGDE_IsmerQO package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
sGDE_IsmerQO package from the gitlasso
The package for Linux/Unix comes
as a gzip tar file. To install, follow these steps:
1- tar zxvf sGDE_IsmerQO-1.2.tar.gz
(or gunzip -c sGDE_IsmerQO-1.2.tar.gz | tar xvf -)
2- cd sGDE_IsmerQO-1.2
3- su - root (become superuser)
4- python setup.py install
And sGDE_IsmerQO should now be
available for execution.
2- Installation of the source code on Windows
To install the sGDE_IsmerQO package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
sGDE_IsmerQO package from the gitlasso
The package for windows comes Windows comes as a zip file.
To install, follow these steps:
1- Download the zip file to a directory such as c:\temp
2- Unzip sGDE_IsmerQO-1.2.zip
3- Open a command window
4- cd c:\temp\sGDE_IsmerQO-1.2
5- python setup.py install
sGDE_IsmerQO.py should now be
available for execution and will have been copied to the Scripts directory of your Python
installation (e.g., c:\Python24\Scripts). In order to use
the sGDE_IsmerQO.py package from anywhere on your machine, you must
add this directory to your PATH environnement variable.
import testPostgres as pf
import traceback
import sys
from tkinter import *
from tkinter import ttk, messagebox
import pandas as pd
import json
#import excel2nc as ex
#bd.cursor.execute("select nextval('seq_int')")
#resultat2=bd.cursor.fetchone()
#print(resultat2)
def geoliste(g):
r=[i for i in range(0,len(g)) if not g[i].isdigit()]
return [int(g[0:r[0]]),int(g[r[0]+1:r[1]]),int(g[r[1]+1:r[2]]),int(g[r[2]+1:])]
def centrefenetre(fen):
fen.update_idletasks()
l,h,x,y=geoliste(fen.geometry())
fen.geometry("%dx%d%+d%+d" % (l,h,(fen.winfo_screenwidth()-l)//2,(fen.winfo_screenheight()-h)//2))
class ConnGraphic(Tk):
def __init__(self):
Tk.__init__(self)
#self.minsize(1200,700)
self.title('connexion a la base de donnees')
self.creerWidgets()
##interface pour la mission
def creerWidgets(self):
self.mainWindow = Frame(self, bg="blue")
self.mainWindow.pack(fill=BOTH, expand=1)
self.frameSaisie = Frame(self.mainWindow, bg="blue")
self.frameSaisie.pack(fill=BOTH)
self.frameResult10 = Frame(self.mainWindow)
self.frameResult10.pack(fill=BOTH)
self.frameResult = Frame(self.frameResult10, bd=4, relief=SUNKEN)
self.frameResult.pack(side=LEFT,fill=X)
self.ent_label = Label(self.frameResult,font=('arial',50,'bold'),bd=4,bg="blue", fg="white", text="Information de connection:")
#self.ent_label.configure(font=('Helvetica', 12),bg="blue", fg="white")
self.ent_label.pack(side=TOP,padx=5, pady=5)
self.frameResult00 = Frame(self.frameResult, bd=4, relief=SUNKEN)
self.frameResult00.pack(fill=BOTH,padx=5, pady=5)
self.modified_label53321 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "host:")
#self.modified_label53321.configure(font=('Helvetica', 12))
#self.modified_label53321.pack(side=LEFT,padx=5, pady=5)
self.modified5332100=StringVar()
self.modified_entry53321= Entry(self.frameResult00,font=('arial',50,'bold'),textvariable=self.modified5332100)
self.modified_label53321.grid(row =0)
self.modified_entry53321.grid(row =0, column=1)
#self.modified_entry53321.pack(side=LEFT,padx=5, pady=5)
#self.modified_entry53321.focus()
#self.frameResult21 = Frame(self.frameResult10, bd=2, relief=SUNKEN)
#self.frameResult21.pack(side=LEFT,fill=Y)
self.modified_label51 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "db info:")
#self.modified_label51.configure(font=('Helvetica', 12))
#self.modified_label51.pack(side=LEFT,padx=25, pady=25)
self.modified_label51.grid(row =1, column =0)
self.modified51=StringVar()
self.modified_entry51=Entry(self.frameResult00,font=('arial',50,'bold'),textvariable=self.modified51)
self.modified_entry51.grid(row =1, column =1)
self.modified_label4 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "User:")
#self.modified_label4.configure(font=('Helvetica', 12))
#self.modified_label4.pack(side=LEFT,padx=25, pady=25)
#self.modified_label4.grid(row =0,column =4)
self.modified4=StringVar()
self.modified_entry4 = Entry(self.frameResult00,font=('arial',50,'bold'),bd=4,textvariable=self.modified4)
self.modified_entry4.grid(row =2, column =1)
self.modified_label4.grid(row =2, column =0)
#self.modified_entry4.pack(side=LEFT,padx=25, pady=25)
#self.modified_entry4.focus()
# self.modified_entry4.grid(row =1,column =4)
#self.frameResult2112 = Frame(self.frameResult, bd=2, relief=SUNKEN)
#self.frameResult2112.pack(side=LEFT,fill=Y)
self.modified_label5 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "Password:")
#self.modified_label5.configure(font=('Helvetica', 12))
self.modified_label5.grid(row =3, column =0)
#self.modified_label5.pack(side=LEFT,padx=25, pady=25)
self.modified5=StringVar()
self.modified_entry5= Entry(self.frameResult00,font=('arial',50,'bold'),textvariable=self.modified5,show="*")
self.modified_entry5.grid(row =3, column =1)
self.btnan = Button(self.mainWindow,font=('arial',50,'bold'),bd=4, text="Se connecter", bg="blue", fg="white", command=self.seconnecter)
self.btnan.pack()
#self.btntablenew = Button(self.mainWindow, text="initialiser",font=('arial',50,'bold'),bd=4, bg="blue", fg="white",command=self.nouveauD)
#self.btntablenew.pack()
#self.frameButtontable1 = Frame(self.frameSaisie, bg="blue")
#self.frameButtontable1.pack(side=LEFT)
#self.btnacceuille = Button(self.frameResult00, text="Acceuil",font=('arial',50,'bold'),bd=4, bg="red", fg="white",command=self.acceuil)
#self.btnacceuille.grid(row=3,column=2)
self.exit_button = Button(self.mainWindow,font=('arial',50,'bold'),bd=4,bg="red",fg="black", text = "Exit", command = self.destroy)
self.exit_button.pack()
def nouveauD(self):
#self.dose.set("")
self.modified5332100.set("")
self.modified51.set("")
self.modified4.set("")
self.modified5.set("")
def seconnecter(self):
playlist = {}
playlist["identifiant"] = {}
playlist["identifiant"]["user"]=self.modified4.get()
playlist["identifiant"]["password"]=self.modified5.get()
playlist["dbinfo"] = {}
playlist["dbinfo"]["db"]=self.modified51.get()
playlist["dbinfo"]["host"]=self.modified5332100.get()
with open('conn1.json', 'w', encoding='utf-8') as f:
json.dump(playlist, f, indent=4)
self.destroy()
#ex.bd.cursor.execute("select nom from groupe order by nom")
#resultat1=ex.bd.cursor.fetchall()
#print("bonjour",resultat1)
#a=pf.recupconf("conn1.json")
#bd=pf.GestionBD(a[0],a[1],a[2],a[3])
#print(a)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import testPostgres as pf
import traceback
import sys
from tkinter import *
from tkinter import ttk, messagebox
import sGDE_IsmerQO as iF
import seconnecter as ex
#ex.bd.cursor.execute("select nextval('seq_int')")
#resultat2=ex.bd.cursor.fetchone()
#print(resultat2)
def geoliste(g):
r=[i for i in range(0,len(g)) if not g[i].isdigit()]
return [int(g[0:r[0]]),int(g[r[0]+1:r[1]]),int(g[r[1]+1:r[2]]),int(g[r[2]+1:])]
def centrefenetre(fen):
fen.update_idletasks()
l,h,x,y=geoliste(fen.geometry())
fen.geometry("%dx%d%+d%+d" % (l,h,(fen.winfo_screenwidth()-l)//2,(fen.winfo_screenheight()-h)//2))
class MotCleGraphic(Tk):
def __init__(self):
Tk.__init__(self)
#self.minsize(1200,700)
self.title('Gestion Mot clé')
self.creerWidgets()
def creerWidgets(self):
self.mainWindow = Frame(self, bg="blue")
self.mainWindow.pack(fill=BOTH, expand=1)
self.frameSaisie = Frame(self.mainWindow, bg="blue")
self.frameSaisie.pack(fill=BOTH)
#self.frameButtoninter = Frame(self.frameSaisie, bg="blue")
#self.frameButtoninter.pack(side=LEFT)
#self.btninter = Button(self.frameButtoninter, text="Nouveau", bg="blue", fg="white")
#self.btninter.pack(padx=5, pady=5)
self.frameButtonmission = Frame(self.frameSaisie, bg="blue")
self.frameButtonmission.pack(side=LEFT)
self.btnmission = Button(self.frameButtonmission,font=('arial',50,'bold'),bd=4, text="modifier", bg="blue", fg="white", command=self.modifier)
self.btnmission.pack(padx=5, pady=5)
self.frameButtontable = Frame(self.frameSaisie, bg="blue")
self.frameButtontable.pack(side=LEFT)
self.btntable = Button(self.frameButtontable,font=('arial',50,'bold'),bd=4, text="supprimer", bg="blue", fg="white",command=self.supprimer)
self.btntable.pack(padx=5, pady=5)
self.frameButtonnew = Frame(self.frameSaisie, bg="blue")
self.frameButtonnew.pack(side=LEFT)
self.btntablenew = Button(self.frameButtonnew,font=('arial',50,'bold'),bd=4, text="nouveau", bg="blue", fg="white",command=self.nouveauD)
self.btntablenew.pack(padx=5, pady=5)
self.frameButtontable1 = Frame(self.frameSaisie, bg="blue")
self.frameButtontable1.pack(side=LEFT)
self.btnacceuille = Button(self.frameButtontable1,font=('arial',50,'bold'),bd=4, text="Acceuil", bg="red", fg="white",command=self.acceuil)
self.btnacceuille.pack(padx=5, pady=5)
#self.frameButtonOk = Frame(self.frameSaisie, bg="blue")
#self.frameButtonOk.pack(side=RIGHT)
#self.btnOk = Button(self.frameButtonOk, text="ok", bg="blue", fg="white")
#self.btnOk.pack(padx=5, pady=10)
#self.frameButtonan = Frame(self.frameSaisie, bg="blue")
#self.frameButtonan.pack(side=RIGHT)
#self.btnan = Button(self.frameButtonan, text="annuler", bg="blue", fg="white")
#self.btnan.pack(padx=5, pady=10)
self.frameButtonsauve = Frame(self.frameSaisie, bg="blue")
self.frameButtonsauve.pack(side=RIGHT)
self.btnsauve = Button(self.frameButtonsauve,font=('arial',50,'bold'),bd=4, text="sauvegarder", bg="blue", fg="white", command=self.sauvegarder)
self.btnsauve.pack(padx=5, pady=10)
self.frameLogin = Frame(self.frameSaisie, bg="blue")
self.frameLogin.pack(side=RIGHT)
self.login = StringVar()
self.loginEntry = Entry(self.frameLogin,font=('arial',50,'bold'),bd=4, textvariable=self.login, width=50)
self.loginEntry.pack(padx=5, pady=5)
self.loginEntry.focus()
self.frameText = Frame(self.frameSaisie, bg="blue")
self.frameText.pack(side=RIGHT)
self.label = Label(self.frameText,font=('arial',50,'bold'),bd=4, text="nom mot clé", bg="blue", fg="white")
self.label.pack(padx=5, pady=5)
self.frameResult10 = Frame(self.mainWindow, bd=4, relief=SUNKEN)
self.frameResult10.pack( fill=BOTH)
self.frameResult = Frame(self.frameResult10, bd=4, relief=SUNKEN)
self.frameResult.pack(side=LEFT,fill=X)
#self.dose_label.grid(in_=self.frameSaisie, row=0, column=1, sticky=NS)
#self.dose_entry.grid(in_=self.frameSaisie, row=0, column=1, sticky=NS)
#self.modified_label.grid(in_=self.frameSaisie, row=0, column=1, sticky=NS)
#self.modified_entry.grid(in_=self.frameSaisie, row=0, column=1, sticky=NS)
#self.exit_button.grid(row = 0, column = 3)
self.modified_label3 = Label(self.frameResult,font=('arial',50,'bold'),bd=4, text = "description mot cle:")
#self.modified_label3.configure(font=('Helvetica', 12))
#self.modified_label3.pack(side=LEFT,padx=25, pady=25)
self.modified3=StringVar()
self.modified_entry3 = Entry(self.frameResult,font=('arial',50,'bold'),bd=4,textvariable=self.modified3,width=70)
#self.modified_entry3.pack(side=LEFT,padx=25, pady=25)
#self.modified_entry3.focus()
self.modified_label3.grid(row =1,column=0)
self.modified_entry3.grid(row =1,column=1)
self.modified_label33 = Label(self.frameResult,font=('arial',50,'bold'),bd=4, text = "seq_mot_clef:")
#self.modified_label3.configure(font=('Helvetica', 12))
#self.modified_label3.pack(side=LEFT,padx=25, pady=25)
self.modified1=StringVar()
self.modified_entry33 = Entry(self.frameResult,font=('arial',50,'bold'),bd=4,textvariable=self.modified1,width=10)
#self.modified_entry3.pack(side=LEFT,padx=25, pady=25)
#self.modified_entry3.focus()
#self.modified_label33.grid(row =2,column=0)
#self.modified_entry33.grid(row =2,column=1)
self.frameResult1 = Frame(self.mainWindow, bd=4, relief=SUNKEN)
self.frameResult1.pack(expand=1, fill=BOTH, padx=15, pady=15)
self.datacols = ('seq_mot_clef','nom_mot_clef','desc_mot_clef',)
self.tree = ttk.Treeview(columns=self.datacols, show='headings')
ysb = ttk.Scrollbar(orient=VERTICAL, command=self.tree.yview)
self.tree['yscroll'] = ysb.set
self.tree.heading('seq_mot_clef', text='seq_mot_clef', anchor=CENTER)
self.tree.heading('nom_mot_clef', text='nom_mot_clef', anchor=CENTER)
self.tree.heading('desc_mot_clef', text='desc_mot_clef', anchor=CENTER)
self.tree.column('seq_mot_clef', anchor=CENTER)
self.tree.column('nom_mot_clef', anchor=CENTER)
self.tree.column('desc_mot_clef', anchor=CENTER)
self.tree.grid(in_=self.frameResult1, row=0, column=0, sticky=NSEW)
ysb.grid(in_=self.frameResult1, row=0, column=1, sticky=NS)
self.frameButtolist = Frame(self.mainWindow, bg="blue")
self.frameButtolist.pack(side=RIGHT)
self.btnan = Button(self.frameButtolist,font=('arial',50,'bold'),bd=4, text="Mes mots cléf", bg="blue", fg="white", command=self.resultatintervenant)
self.btnan.pack(padx=5, pady=10)
self.frameResult1.rowconfigure(0, weight=1)
self.frameResult1.columnconfigure(0, weight=1)
style = ttk.Style()
style.configure(".", font=('arial',50,'bold'),bd=4, foreground="white")
style.configure("Treeview.Heading", font=('arial', 5,'bold'), foreground='blue')
self.tree.tag_configure('oddrow', background='#06C')
self.tree.tag_configure('evenrow', background='#066', anchor=CENTER)
self.frameHL = Frame(self.mainWindow, bd=4, relief=SUNKEN)
self.HL = ('H(X)')
self.treeHL = ttk.Treeview(columns=self.HL, show='headings', height='0')
self.exit_button = Button(self.mainWindow,font=('arial',50,'bold'),bd=4,bg="red",fg="black", text = "Exit", command = self.mainWindow.quit)
self.exit_button.pack()
#self.update_layout()
self.tree.bind('<Double-Button-1>', self.on_configure)
#choix d un intervenant
def acceuil(self):
#prob = self.loginEntry.get().strip().split(' ')
try:
self.destroy()
self.groupe= iF.InterfaceGraphic()
#self.groupe.mainloop()
#print("bonjour")
except Exception as err:
print("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de saisie", "impossible de lancer cette interface.")
def on_configure(self, event):
w,h = event.x, event.y
#natural = self.frameResult1.winfo_reqwidth()
#print(self.tree.identify_element(w,h))
seltxt = self.tree.set(self.tree.selection(), 'seq_mot_clef')
if ex.bd.echec:
raise ValueError("Erreur : connection echoue")
#prob = [float(i) for i in prob if i!='' and i!='0']
ex.bd.cursor.execute("""select seq_mot_clef,nom_mot_clef,desc_mot_clef from mots_clefs where seq_mot_clef= '%s'"""%seltxt)
resultat=ex.bd.cursor.fetchone()
self.modified3.set(resultat[2])
self.login.set(resultat[1])
self.modified1.set(resultat[0])
def nouveauD(self):
self.modified3.set("")
self.modified1.set("")
self.login.set("")
#self.tree.itemconfigure('inner', width= w if w>natural else natural)
#self.tree.configure(scrollregion=self.tree.bbox('.'))
#inserer un intervenant
def sauvegarder(self):
#natural = self.frameResult1.winfo_reqwidth()
#print(self.tree.identify_element(w,h))
#sql.append((str(self.nom.get()).encode("utf8"),str(self.modified1.get()).encode("utf8"),str(self.modified3.get()).encode("utf8"),str(self.modified2.get()).encode("utf8")))
if self.modified3.get()=="":
messagebox.showerror("Erreur de requête", "le champs description mots_clefs doit contenir une valeur.")
elif self.login.get()=="":
messagebox.showerror("Erreur de requête", "le champs nom_mot_clef doit contenir une valeur.")
else:
base="""INSERT INTO mots_clefs(nom_mot_clef,desc_mot_clef) VALUES(%s, %s)"""
try:
ex.bd.cursor.execute(base,(self.login.get(),self.modified3.get()))
messagebox.showinfo("Information","Insertion reussi avec succes.")
ex.bd.commit()
except Exception as err:
# afficher la requête et le message d'erreur système :
print ("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (base, err))
messagebox.showerror("Erreur de saisie", "La requête n est pas correcte.")
ex.bd.rollback()
def modifier(self):
if self.modified3.get()=="":
messagebox.showerror("Erreur de requête", "le champs desc_typ_jd doit contenir une valeur.")
elif self.login.get()=="":
messagebox.showerror("Erreur de requête", "le champs acronyme intervenant doit contenir une valeur.")
else:
#ex.bd.cursor.execute("""select seq_mot_clef from mots_clefs where seq_mot_clef= '%s'"""%self.modified1.get())
#resultat=ex.bd.cursor.fetchone()
#if resultat != None:
# messagebox.showerror("Erreur de requête","Existe deja dans la base de données '%s'"""%self.login.get())
#else:
base="UPDATE mots_clefs SET nom_mot_clef=%s, desc_mot_clef=%s where seq_mot_clef=%s"
try:
ex.bd.cursor.execute(base,(self.login.get(),self.modified3.get(),self.modified1.get()))
messagebox.showinfo("requete","modification reussi avec succes.")
ex.bd.commit()
self.resultatintervenant()
except Exception as err:
# afficher la requête et le message d'erreur système :
print ("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (base, err))
messagebox.showerror("Erreur de saisie", "La requête n est pas correcte.")
ex.bd.rollback()
#self.tree.itemconfigure('inner', width= w if w>natural else natural)
#self.tree.configure(scrollregion=self.tree.bbox('.'))
def resultatrequete(self):
#prob = self.loginEntry.get().strip().split(' ')
prob = self.loginEntry.get()
if ex.bd.echec:
raise ValueError("Erreur : connection echoue")
try:
#prob = [float(i) for i in prob if i!='' and i!='0']
ex.bd.cursor.execute(prob)
resultat=ex.bd.cursor.fetchall()
self.frameHL.pack(fill=BOTH, padx=15, pady=5)
self.tree.delete(END, 'end',tags = ('oddrow',))
for el in resultat:
self.tree.insert('', END, values=(el), tags = ('oddrow',))
#self.treeHL.heading('H(X)', text='H(X) = '+str(resultat), anchor=CENTER)
#self.treeHL.heading('L', text='L = '+str(result[2]), anchor=CENTER)
#self.treeHL.heading('u', text='Efficacité(µ) = '+str(result[3]), anchor=CENTER)
self.treeHL.grid(in_=self.frameHL, row=0, column=0, sticky=NSEW)
self.frameHL.rowconfigure(0, weight=1)
self.frameHL.columnconfigure(0, weight=1)
except:
messagebox.showerror("Erreur de saisie", "La requête n est pas correcte. saisie")
#lister les intervenant
def resultatintervenant(self):
#prob = self.loginEntry.get().strip().split(' ')
a=[]
self.tree.delete(*self.tree.get_children())
prob = self.loginEntry.get()
if ex.bd.echec:
raise ValueError("Erreur : connection echoue")
try:
#prob = [float(i) for i in prob if i!='' and i!='0']
ex.bd.cursor.execute("select seq_mot_clef,nom_mot_clef,desc_mot_clef from mots_clefs order by nom_mot_clef")
resultat=ex.bd.cursor.fetchall()
self.frameHL.pack(fill=BOTH, padx=15, pady=5)
for el in resultat:
self.tree.insert('', END, values=(el[0],el[1],el[2]), tags = ('oddrow',))
self.treeHL.grid(in_=self.frameHL, row=0, column=0, sticky=NSEW)
self.frameHL.rowconfigure(0, weight=1)
self.frameHL.columnconfigure(0, weight=1)
except:
messagebox.showerror("Erreur de saisie", "La requête n est pas correcte babacar.")
def supprimer(self):
#prob = self.loginEntry.get().strip().split(' ')
prob = self.loginEntry.get()
if ex.bd.echec:
raise ValueError("Erreur : connection echoue")
try:
#prob = [float(i) for i in prob if i!='' and i!='0']
tables={"POLYGONE":"acr_nom_int","SERIE":"acr_nom_int_chargement","JEU_DONNEES":"acr_nom_int_insc","proj_prog":"acr_nom_int","mission_exp":"acr_nom_int"}
for i,j in tables.items():
ex.bd.cursor.execute("SELECT count(*) from "+i+" where "+j+"='"+(self.login.get())+"' ")
seq=ex.bd.cursor.fetchone()
if seq[0] > 0 :
messagebox.showerror("requete","L intervenant "+(self.login.get())+" ne peut pas etre supprimé car il apparait deja dans la table "+i+".")
return
table={"intervenant_groupe":"seq_intervenant"}
for i,j in table.items():
ex.bd.cursor.execute("SELECT count(*) from "+i+" where "+j+"='"+(self.dose.get())+"' ")
seq=ex.bd.cursor.fetchone()
if seq[0] > 0 :
messagebox.showerror("requete","L intervenant "+(self.login.get())+" ne peut pas etre supprimé car il apparait deja dans la table "+i+".")
return
ex.bd.cursor.execute("DELETE from intervenant where acr_nom_int='"+(self.login.get())+"' ")
messagebox.showinfo("requete", "suppression faite avec succes.")
ex.bd.commit()
except Exception as err:
print ("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de requete", "ces donnees ont associes a d'autres tables.")
return
ex.bd.rollback()
def resultattable(self):
#prob = self.loginEntry.get().strip().split(' ')
prob = self.loginEntry.get()
if ex.bd.echec:
raise ValueError("Erreur : connection echoue")
try:
#prob = [float(i) for i in prob if i!='' and i!='0']
ex.bd.cursor.execute("select tablename from pg_tables where schemaname='sgde'")
resultat=ex.bd.cursor.fetchall()
self.frameHL.pack(fill=BOTH, padx=15, pady=5)
for el in resultat:
self.tree.insert('', END, values=(el), tags = ('oddrow',))
#self.treeHL.heading('H(X)', text='H(X) = '+str(resultat), anchor=CENTER)
#self.treeHL.heading('L', text='L = '+str(result[2]), anchor=CENTER)
#self.treeHL.heading('u', text='Efficacité(µ) = '+str(result[3]), anchor=CENTER)
self.treeHL.grid(in_=self.frameHL, row=0, column=0, sticky=NSEW)
self.frameHL.rowconfigure(0, weight=1)
self.frameHL.columnconfigure(0, weight=1)
except:
messagebox.showerror("Erreur de saisie", "La requête n est pas correcte.")