-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui_log.py
90 lines (68 loc) · 2.84 KB
/
gui_log.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import tkinter as tk
import os
from PIL import ImageTk, Image
from sign_log_pyre import LogSign
root = tk.Tk()
root.geometry('500x500')
def log_to_fire(*args):
if(len(entry_id.get()) == 0):
global id_msg
id_msg = tk.Label(root, text="Email Field Must Required",
width=20, font=("bold", 8), pady=10, fg='red')
id_msg.grid(row=5, column=4)
elif(len(entry_password.get()) == 0):
try:
id_msg.grid_forget()
except:
pass
global password_msg
password_msg = tk.Label(root, text="Password Field Must Required",
width=20, font=("bold", 8), pady=10, fg='red')
password_msg.grid(row=7, column=4)
else:
try:
password_msg.grid_forget()
except:
pass
login = LogSign()
data_src = login.login_method(email=entry_id.get(),
password=entry_password.get())
msg = tk.Label(root, text=data_src[0], width=20,
font=("bold", 12), pady=10, fg='green')
msg.grid(row=10, column=4)
data = data_src[1]
profile_img = Image.open(data_src[2])
profile_img = profile_img.resize((100, 100), Image.ANTIALIAS)
profile_img = ImageTk.PhotoImage(profile_img)
panel = tk.Label(root, image=profile_img)
panel.image = profile_img
panel.grid(row=12, column=2)
name_msg_show = tk.Label(root, text="Name : " + data['name'], width=20,
font=("bold", 12), pady=10, fg='green')
name_msg_show.grid(row=14, column=2)
email_msg_show = tk.Label(root, text="Email : " + data['email'], width=20,
font=("bold", 12), pady=10, fg='green')
email_msg_show.grid(row=16, column=2)
# img = ImageTk.PhotoImage(Image.open(data_src[2]))
# panel = tk.Label(root, image = img)
# panel.grid(row=14, column=2)
# panel.pack(side = "bottom")
def signin_module(*args):
root.destroy()
import gui_sign_pyre
signin_btn = tk.Button(root, text='Sign In', fg='white',
bg='brown', command=signin_module)
signin_btn.grid(row=2, column=5)
id = tk.Label(root, text="Email ID", width=20, font=("bold", 12), pady=10)
id.grid(row=4, column=2)
entry_id = tk.Entry(root, width=35)
entry_id.grid(row=4, column=4)
password = tk.Label(root, text="Password", width=20,
font=("bold", 12), pady=10)
password.grid(row=6, column=2)
entry_password = tk.Entry(root, width=35)
entry_password.grid(row=6, column=4)
login_btn = tk.Button(root, text='Log In', fg='white',
bg='brown', command=log_to_fire)
login_btn.grid(row=8, column=4)
tk.mainloop()