Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PyQt4.QtGui import *
- from PyQt4.QtCore import *
- from sys import argv
- import MainLogin
- import Register
- import enregistrement
- import fileinput
- import sqlite3
- apl = QApplication(argv)
- class login(QMainWindow, MainLogin.Ui_MainMenu):
- def __init__(self):
- super(login, self).__init__()
- self.setupUi(self)
- self.connect(self.SignUp , SIGNAL("clicked()"), self.reg )
- self.connect(self.Login , SIGNAL("clicked()"), self.log )
- self.connect(self.checkBox , SIGNAL('clicked()'), self.showpass)
- self.user = str(self.utilisateur.text() )
- self.user = str(self.user).lower()
- self.passw = self.password.text()
- def reg(self):
- self.obreg = enregistrement.register()
- self.obreg.show()
- def LogIn(self, user, passw):
- self.d.execute(""" SELECT * FROM users WHERE username = ? AND password = ?""", (user, passw))
- self.res = self.d.fetchall()
- if len(self.res) == 1:
- return True
- else:
- return False
- def log(self):
- self.con = sqlite3.connect("DataBase.db")
- self.d = self.con.cursor()
- self.login(self.user, self.pw)
- if True :
- print'ih'
- else:
- print "lala"
- def showpass(self):
- self.password.setEchoMode(QLineEdit.Normal )
- if self.checkBox.isChecked():
- self.password.setEchoMode(QLineEdit.Normal )
- else:
- self.password.setEchoMode(QLineEdit.Password)
- oblog=login()
- oblog.show()
- apl.exec_()
Add Comment
Please, Sign In to add comment