Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import tkinter as tk # python 3
from tkinter import font as tkfont # python 3
from tkinter import messagebox
Expand All @@ -24,7 +23,7 @@ def __init__(self, *args, **kwargs):
# Initialize connection to database:
self.db_url = "https://docs.google.com/spreadsheets/d/144bmhnqKytJMZwtBWR0IJ_UFbGy4gWWqukEfHV6laEU/edit?usp=sharing"
self.gc = gspread.service_account(
filename="./service_account.json")
filename="C:/Users/amerm/OneDrive - Technion/Desktop/ioT project/service_account.json")
self.db = self.gc.open_by_url(self.db_url)

# Scheduled System Backup:
Expand Down Expand Up @@ -120,7 +119,6 @@ def validate_login(self, id):
self.show_notification(notification="Empty Fields")
self.show_frame('StartPage')
return

id = self.convert_string(id)

self.show_frame('IDScanLoadingPage')
Expand Down Expand Up @@ -294,11 +292,10 @@ def __init__(self, parent, controller):
for row_index, row in enumerate(button_grid):
for col_index, number in enumerate(row):
if number == 'Clear':
button = tk.Button(button_frame, text=number, command=self.handle_clear_button_click,
button = tk.Button(button_frame, text=number,bg ='red' , command=self.handle_clear_button_click,
font=("Helvetica", 20))
elif number == 'Login':
button = tk.Button(button_frame, text=number, font=("Helvetica", 20),
command=lambda: controller.validate_login(self.username_entry.get()))
button = tk.Button(button_frame, text=number,bg ='green' , font=("Helvetica", 20),command=lambda: controller.validate_login(self.username_entry.get()))
else:
button = tk.Button(button_frame, text=number, command=lambda n=number: self.handle_num_button_click(n),
font=("Helvetica", 20))
Expand Down Expand Up @@ -349,9 +346,7 @@ def __init__(self, parent, controller):
font=('Helvetica', 17, 'bold'))
view_transactions_button.pack(pady=10)

logout_button = tk.Button(self, text="Logout",
command=lambda: controller.logout(),
font=('Helvetica', 14))
logout_button = tk.Button(self, text="Logout",bg = 'red' , command=lambda: controller.logout(),font=('Helvetica', 14))
logout_button.pack(pady=5)


Expand Down Expand Up @@ -525,6 +520,3 @@ def on_enter(self, event):

app = SampleApp()
app.mainloop()