Ejemplo n.º 1
0
def login():
    # Conexión a la base de datos
    db = sqlite3.connect('/Users/hever/Downloads/login-v2/login.db')
    c = db.cursor()

    usuario = username_en.get()
    contr = password_en.get()

    c.execute('SELECT * FROM usuarios WHERE usuario = ? AND pass = ?',
              (usuario, contr))

    if c.fetchall():
        showinfo(title="Login exitoso",
                 message="Sesion iniciada correctamente")
        home()
    else:
        showerror(title="Ups, algo ha salido mal",
                  message="Usuario o contraseña incorrectos")
        opcion = askretrycancel(message="¿Desea reintentar?",
                                title="Reintentar")
        print(opcion)
        if opcion == True:
            showinfo(title="Nuevo intento",
                     message="Introdue tus datos correctamente")
        else:
            ventana_login.destroy()

    c.close()
    def login(self):

        uid = self.lineEdit.text()
        # if uid == '' or uid == "null":
        # if uid == '' or uid == "null":
        #     self.alertmsg("ERROR", "Please Enter Your Username")

        passwd = self.lineEdit_2.text()
        # if passwd == '' or passwd == "null":
        #     self.alertmsg("ERROR", "Please Type Your Password")

        mydb = mysql.connector.connect(host="localhost",
                                       user="******",
                                       password="******",
                                       database='diabetes')
        cursor = mydb.cursor()
        query = "SELECT userid,password FROM `registration` WHERE userid = (%s) AND password = (%s) "
        cursor.execute(query, (
            uid,
            passwd,
        ))

        if (len(cursor.fetchall()) > 0):
            # self.alertmsg("LoggedIn", "Login Successfully")
            self.Dialog = QtWidgets.QDialog()
            self.ui = home()
            self.ui.setupUi(self.Dialog)
            self.Dialog.show()

            # app.exec_()

        else:
            self.alertmsg("ERROR",
                          "Please Enter Correct Username And Password")
Ejemplo n.º 3
0
	def login(self):
		i=None
		self.error=Label(self.root,text="Invalid Credentials",font="Helvetical 20")
		self.staff_id=self.username.get()
		self.password=self.passdata.get()
		
		try:
			self.con.query("select * from password where(staffid='"+self.staff_id+"' and pass='******'); ")
			i=self.con.store_result()
			j=i.fetch_row()
			if(j):
				if ('s' in j[0][0]):
					self.root.destroy()
					y=lower_staff(self.con,j[0][0])
				elif(j[0][0]=='1jb111'):
					self.root.destroy()
					y=home_principal(self.con)
				else:
					self.root.destroy()
					y=home(self.con,j[0][0])
			else:
				self.error=Label(self.root,text="Invalid Credentials",font="Helvetical 20")
				self.error.place(x=350,y=530)
		except:
			self.error=Label(self.root,text="Invalid Credentials",font="Helvetical 20")
			self.error.place(x=350,y=530)
Ejemplo n.º 4
0
dir = "C:\Users\Konstantin\Desktop"

find_dirs(dir)
print "find_dirs() ... fin"
with open('DIRS.CitraLite') as dirs:
    for dir in dirs:
        dir = dir.replace("\n", "")
        #print dir
        if os.path.isdir(dir) == True:
            #		print "TRUE"
            os.system("make_thumbnail.py %s" % dir)
            dir_html(dir)
    #		print dir
    #	print os.path.isdir(dir)
print "make(), dir_html() ... fin"
home()
print "home() ... fin"
color_html(dir, "red")
print " red"
color_html(dir, "green")
print " green"
color_html(dir, "blue")
print " blue"
color_html(dir, "black")
print " black"
color_html(dir, "while")
print " while"
color_html(dir, "yellow")
print " yellow"
Ejemplo n.º 5
0
def main():
   root = Tk()
   c = Control()
   home(root, c)
   root.mainloop()
Ejemplo n.º 6
0
	def backToHome(self):
		win.destroy()
		from home import home
		home().makeWindow(me)
Ejemplo n.º 7
0
    def test_home(self):
        from {{cookiecutter.pkg_name}}.views import home

        res = home(self.request)
        self.assertEqual(res["project"], "{{cookiecutter.pkg_name}}")
Ejemplo n.º 8
0
 def bukaClick(self):
     self.form = home()
     self.form.show()
     self.close()
def test_index_success(app_request):
    info = home(app_request)
    assert app_request.response.status_int == 200
    assert info['project'] == '{{ cookiecutter.project_name }}'
Ejemplo n.º 10
0
	def Home(self):
		home()
Ejemplo n.º 11
0
dir = "C:\Users\Konstantin\Desktop"

find_dirs(dir)
print "find_dirs() ... fin"
with open('DIRS.CitraLite') as dirs:
	for dir in dirs:
		dir = dir.replace("\n", "")
#print dir
		if os.path.isdir(dir) == True:
	#		print "TRUE"
			os.system("make_thumbnail.py %s"%dir)
			dir_html(dir)
	#		print dir
		#	print os.path.isdir(dir)
print "make(), dir_html() ... fin"
home()
print "home() ... fin"
color_html(dir, "red")
print " red"
color_html(dir, "green")
print " green"
color_html(dir, "blue")
print " blue"
color_html(dir, "black")
print " black"
color_html(dir, "while")
print " while"
color_html(dir, "yellow")
print " yellow"