Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. from PyQt4.QtGui import *
  2. from PyQt4.QtCore import *
  3. from sys import argv
  4. import MainLogin
  5. import Register
  6. import enregistrement
  7. import fileinput
  8. import sqlite3
  9.  
  10. apl = QApplication(argv)
  11.  
  12. class login(QMainWindow, MainLogin.Ui_MainMenu):
  13. def __init__(self):
  14. super(login, self).__init__()
  15. self.setupUi(self)
  16. self.connect(self.SignUp , SIGNAL("clicked()"), self.reg )
  17. self.connect(self.Login , SIGNAL("clicked()"), self.log )
  18. self.connect(self.checkBox , SIGNAL('clicked()'), self.showpass)
  19.  
  20.  
  21.  
  22. self.user = str(self.utilisateur.text() )
  23. self.user = str(self.user).lower()
  24. self.passw = self.password.text()
  25.  
  26.  
  27.  
  28.  
  29. def reg(self):
  30. self.obreg = enregistrement.register()
  31. self.obreg.show()
  32. def LogIn(self, user, passw):
  33. self.d.execute(""" SELECT * FROM users WHERE username = ? AND password = ?""", (user, passw))
  34. self.res = self.d.fetchall()
  35. if len(self.res) == 1:
  36. return True
  37. else:
  38. return False
  39. def log(self):
  40. self.con = sqlite3.connect("DataBase.db")
  41. self.d = self.con.cursor()
  42. self.login(self.user, self.pw)
  43. if True :
  44. print'ih'
  45. else:
  46. print "lala"
  47.  
  48.  
  49. def showpass(self):
  50. self.password.setEchoMode(QLineEdit.Normal )
  51. if self.checkBox.isChecked():
  52. self.password.setEchoMode(QLineEdit.Normal )
  53. else:
  54. self.password.setEchoMode(QLineEdit.Password)
  55.  
  56.  
  57.  
  58.  
  59.  
  60. oblog=login()
  61. oblog.show()
  62.  
  63. apl.exec_()
Add Comment
Please, Sign In to add comment