def __init__(self): QDialog.__init__(self) self.setWindowTitle("IkeoOoooooo") self.setGeometry(500, 150, 300, 250) self.setStyleSheet("background-color: #003399; color: #FFFFFF") try: self.data = Bdd() except mysql.connector.errors.InterfaceError: self.pop = Popup() self.pop.connex_err() self.label = QLabel() self.label2 = QLabel() self.label3 = QLabel() self.label.setText("Voici la liste de nos sites de production :") self.label2.setText(self.affichage5()) self.label.setAlignment(Qt.AlignCenter) self.label2.setAlignment(Qt.AlignCenter) self.label2.setStyleSheet( "border: 4px solid #FFCC00; font: 10pt Tahoma; color: #FFCC00") layout = QVBoxLayout() layout.addWidget(self.label) layout.addWidget(self.label2) layout.addWidget(self.label3) self.setLayout(layout)
def __init__(self): QDialog.__init__(self) self.setWindowTitle("IkeoOoooooo") self.setGeometry(500, 50, 500, 450) self.setStyleSheet("background-color: #003399; color: #FFFFFF") try: self.data = Bdd() except mysql.connector.errors.InterfaceError: self.pop = Popup() self.pop.connex_err()
def __init__(self): QDialog.__init__(self) self.setWindowTitle("IkeoOoooooo") self.setGeometry(500, 50, 500, 450) self.setStyleSheet("background-color: #003399; color: #FFFFFF") try: self.data = Bdd() except mysql.connector.errors.InterfaceError: self.pop = Popup() self.pop.connex_err() self.vide = QLabel() self.invit0 = QLabel() self.invit0.setText("Nom du produit :") self.invit1 = QLabel() self.invit1.setText("Référence :") self.invit2 = QLabel() self.invit2.setText("Description :") self.invit3 = QLabel() self.invit3.setText("Statut du produit :") self.invit4 = QLabel() self.invit4.setText("Site de production :") self.affect_statut = QComboBox(self) self.affect_statut.addItems( ['Commercialisation abandonnée', 'Commercialisé']) self.affect_site = QComboBox(self) self.affect_site.addItems(self.data.lister_sites()) self.champ0 = QLineEdit() self.champ1 = QLineEdit() self.champ2 = QLineEdit() self.btok = QPushButton("Entrer dans la base") self.btok.resize(100, 30) self.btok.clicked.connect(self.appui_ok6) self.label = QLabel() layout = QVBoxLayout() layout.addWidget(self.invit0) layout.addWidget(self.champ0) layout.addWidget(self.invit1) layout.addWidget(self.champ1) layout.addWidget(self.invit2) layout.addWidget(self.champ2) layout.addWidget(self.invit3) layout.addWidget(self.affect_statut) layout.addWidget(self.invit4) layout.addWidget(self.affect_site ) ## ajouter possibilité d'affecter plusieurs sites layout.addWidget(self.vide) layout.addWidget(self.btok) layout.addWidget(self.label) self.setLayout(layout)
def __init__(self): QDialog.__init__(self) self.setWindowTitle("IkeoOoooooo") self.setGeometry(500, 50, 500, 450) self.setStyleSheet("background-color: #003399; color: #FFFFFF") try: self.data = Bdd() except mysql.connector.errors.InterfaceError: self.pop = Popup() self.pop.connex_err() self.vide = QLabel() self.invit1 = QLabel() self.invit1.setText("Choisir le type de client :") self.invit2 = QLabel() self.invit2.setText("Nom du client :") self.invit3 = QLabel() self.invit3.setText("Adresse :") self.invit4 = QLabel() self.invit4.setText("Ville :") self.invit5 = QLabel() self.invit5.setText("Pays :") self.affect_typecl = QComboBox(self) self.affect_typecl.addItems(['Magasin', 'Central d\'achat']) self.affect_pays = QComboBox(self) self.affect_pays.addItems(self.data.lister_pays()) self.champ2 = QLineEdit() self.champ3 = QLineEdit() self.champ4 = QLineEdit() self.btok = QPushButton("Entrer dans la base") self.btok.resize(100, 30) self.btok.clicked.connect(self.appui_ok4) self.label = QLabel() layout = QVBoxLayout() layout.addWidget(self.invit1) layout.addWidget(self.affect_typecl) layout.addWidget(self.invit2) layout.addWidget(self.champ2) layout.addWidget(self.invit3) layout.addWidget(self.champ3) layout.addWidget(self.invit4) layout.addWidget(self.champ4) layout.addWidget(self.invit5) layout.addWidget(self.affect_pays) layout.addWidget(self.vide) layout.addWidget(self.btok) layout.addWidget(self.label) self.setLayout(layout)
def main(): #os.chdir("..\\..\\Mail apprenants") monfichier = Traitement("apprenantmail.txt") mailing = monfichier.lire_fichier() donnees = Bdd() donnees_apprenants = donnees.lire_data() donnees.ajouter_colonne() for ligne in donnees_apprenants: ligne.mail = definir_mail(mailing, ligne.pseudo) print(ligne.nom_etudiant, ligne.prenom_etudiant, ligne.id_etudiant, ligne.pseudo, ligne.mail) donnees.ecrire_mail(ligne.mail, ligne.id_etudiant) donnees.fermer_bdd()
def __init__(self): QDialog.__init__(self) self.setWindowTitle("IkeoOoooooo") self.setGeometry(500, 50, 400, 450) self.setStyleSheet("background-color: #003399; color: #FFFFFF") try: self.data = Bdd() except mysql.connector.errors.InterfaceError: self.pop = Popup() self.pop.connex_err() self.vide = QLabel() self.texte_invit = QLabel() self.texte_invit.setText("Choisir un client :") self.texte_invit2 = QLabel() self.texte_invit2.setText("Date de facturation (AAAA-MM-JJ) :") self.listeclients = QComboBox() self.listeclients.addItems(self.data.lister_clients()) self.champ = QLineEdit() self.btok = QPushButton("Rechercher") self.btok.clicked.connect(self.appui_ok2) self.label = QLabel() self.label.setStyleSheet("font: 10pt Tahoma; color: #FFCC00") layout = QVBoxLayout() layout.addWidget(self.vide) layout.addWidget(self.texte_invit) layout.addWidget(self.listeclients) layout.addWidget(self.texte_invit2) layout.addWidget(self.champ) layout.addWidget(self.vide) layout.addWidget(self.btok) layout.addWidget(self.vide) layout.addWidget(self.label) layout.addWidget(self.vide) self.setLayout(layout)
@author: s.granel """ #Imports import pandas as pd import numpy as np import sys from bdd import Bdd from data import Data from ai import AI folder = sys.argv[1] #folder = "" filename = "predict_fuel_v2_400.h5" idpdv = 33600001 idcarburant = 1 # Jeu d'entrainement training_set = pd.DataFrame(columns=['A', 'B', 'C', 'D', 'E']) bdd = Bdd(True) training_set = bdd.getTrainingSetFuelV2(training_set, idpdv, idcarburant) training_set = np.flip(training_set, 0) data = Data(400) data.filledDataFuelPerpetual(training_set) ai = AI(folder, filename) ai.prepetualTraining(data.getXTrain(), data.getYTrain()) ai.save()
def decrypt(): sqlite = Bdd() reading = sqlite.hash_bdd() global mail global identify global title2 global police2 global anti_brute_force global voice title2.pack() a = 0 b = 0 mot_finale = [] identify_encode = identify.get().encode("utf-8") mail_encode1 = mail.get() if bcrypt.checkpw(identify_encode, reading): liste = list(identify.get()) while a < 16: a += 1 mot_finale.append(liste[b]) b += 1 if b == len(liste): b = 0 else: continue mot_finale2 = ''.join(mot_finale) crypt = Cypher(mot_finale2) encryption_test = crypt.encrypt(mail_encode1) curseur3 = connexion.cursor() curseur3.execute("SELECT mail FROM auth") result = curseur3.fetchall() search_password = [] for resultat in result: result_decode = result[0] search_password.append(resultat[0]) connexion.commit() curseur4 = connexion.cursor() a = 0 for element in search_password: if element == encryption_test: curseur4.execute("SELECT pass FROM auth WHERE mail=?", [element]) result2 = curseur4.fetchone() connexion.commit() crypt = Cypher(mot_finale2) unpad_decrypt = crypt.decrypt(result2[0]) if voice.get() == 1: tts = gTTS('Your password is ' + unpad_decrypt, 'en') tts.save('voice.mp3') playsound('voice.mp3') os.remove("voice.mp3") return 0 else: resp = "The password is" + unpad_decrypt color_resp = "green" title2.pack_forget() title2 = Button(window, text=resp, bg=color_background, fg=color_resp, width=1000, height=2, borderwidth=0, font=police2) title2.pack() connexion.commit() a = 0 anti_brute_force = 0 return 0 else: a = 5 if a == 5: resp = "the email was not found" color_resp = "red" title2.pack_forget() title2 = Button(window, text=resp, bg=color_background, fg=color_resp, width=1000, height=2, borderwidth=0, font=police2) title2.pack() connexion.commit() return 0 else: if anti_brute_force == 6: resp = "Anti brute force activated for 30 seconds of inactivity" anti_brute_force = 0 else: resp = "The ID is false" color_resp = "red" title2.pack_forget() title2 = Button(window, text=resp, bg=color_background, fg=color_resp, width=1000, height=2, borderwidth=0, font=police2) title2.pack() return 0 if resp == "Anti brute force activated for 30 seconds of inactivity": time.sleep(30) anti_brute_force += 1 connexion.commit() global nombre_error nombre_error += 1 color_resp = "grey" resp = "ok" if nombre_error == 1: title2 = Button(window, text=resp, bg=color_background, fg=color_resp, width=1000, height=2, borderwidth=0, font=police2) else: title2.pack_forget()
def main(): open = Opening() open.hash() svocal = Vocal() svocal.synthese() sqlite = Bdd() global identify global mail global police2 global voice police = font.Font(family='Arial', size=25, weight='bold') police2 = font.Font(family='Arial', size=10, weight='bold') photo = PhotoImage(file='logo.png') logo = Button(window, image=photo, bg=color_background, fg='white', width=1000, height=100, borderwidth=0, font=police) title = Button(window, text="STOCK", bg=color_background, fg='white', width=1000, height=1, borderwidth=0, font=police) saut_ligne = Button(window, text="Your email", bg=color_background, fg='white', width=100, height=3, borderwidth=0, font=police2) saut_ligne1 = Button(window, text="Your ID", bg=color_background, fg='white', width=100, height=3, borderwidth=0, font=police2) button_active = Button(window, text="view your password", bg="black", fg='white', width=40, height=2, borderwidth=0, command=decrypt, font=police2) saut_ligne3 = Button(window, bg=color_background, fg='white', width=100, height=3, borderwidth=0, font=police2) saut_ligne4 = Button(window, bg=color_background, fg='white', width=100, height=3, borderwidth=0, font=police2) saut_ligne5 = Button(window, bg=color_background, fg='white', width=100, height=3, borderwidth=0, font=police2) identife = Entry(window, show="*", textvariable=identify, width=30) window.title("STOCK|software password") logo.pack() title.pack() saut_ligne.pack() mail_entry = Entry(window, textvariable=mail, width=30) mail_entry.pack() saut_ligne1.pack() identife = Entry(window, show="*", textvariable=identify, width=30) identife.pack() saut_ligne4.pack() button_active.pack() saut_ligne3.pack() valide_voice = Checkbutton(window, text="say the password (voice synthesis)", background=color_background, variable=voice) valide_voice.pack() window.configure(background=color_background) window.geometry('850x690+0+10') window.iconbitmap(r"nuage.ico") window.resizable(0, 0) encrypt() window.mainloop() sqlite.end_program()
def encrypt_test(): global add_identify global add_password_up global title_2_2 global connexion title_2_2.pack() sqlite = Bdd() reading = sqlite.hash_bdd() identify_encode1 = add_identify.get().encode("utf-8") mail_encode = add_mail.get() password_encode = add_password_up.get() a = 0 mot_finale = [] b = 0 if bcrypt.checkpw(identify_encode1, reading): liste = list(add_identify.get()) while a < 16: a += 1 mot_finale.append(liste[b]) b += 1 if b == len(liste): b = 0 else: continue mot_finale2 = ''.join(mot_finale) crypt = Cypher(mot_finale2) id1 = crypt.encrypt(mail_encode) id2 = crypt.encrypt(password_encode) curseur_ajout = connexion.cursor() curseur_ajout.executescript(''' CREATE TABLE IF NOT EXISTS auth( mail TEXT, pass TEXT)''') curseur_ajout.execute("SELECT mail FROM auth WHERE mail=?", [id1]) result2 = curseur_ajout.fetchall() if result2 != []: color_resp = "red" resp = "The email already exists" title2_2 = Button(window_add, text=resp, bg=color_background, fg=color_resp, width=1000, height=2, borderwidth=0, font=police2) title2_2.pack() return 0 color_resp = "green" curseur_ajout.execute("PRAGMA table_info(auth);") curseur_ajout.execute('''INSERT INTO auth (mail,pass) VALUES (?,?)''', (id1, id2)) connexion.commit() resp = "Email and password added" title2_2 = Button(window_add, text=resp, bg=color_background, fg=color_resp, width=1000, height=2, borderwidth=0, font=police2) title2_2.pack() return 0 else: color_resp = "red" resp = "The ID is false" title2_2 = Button(window_add, text=resp, bg=color_background, fg=color_resp, width=1000, height=2, borderwidth=0, font=police2) title2_2.pack()