def log_in(self,user_name): #variables ob=Sqlite() o=Face_Recognize() #checking if username is present in table x=ob.check_user(user_name) if x==0: #username is present and verifing face g=o.login(user_name) return g return "Username not found"
def sign_up(self,user_name,email): # 1) Functions variables ob=Sqlite() x=Email_verify() face=Face_Recognize() # 2) User name verification y=ob.check_user(user_name) if y==0: return "Username Already Exists" # 3) Email Id Verification t=x.verify_email(email) if t==-1: return "Invalid Formate of Email" elif t==0: return "Email doesn't exists" email=input("Email_Id") t=x.verify_email(email) # 4) Face_Recognition Verification data_path='./user_photo/' flag=0 #Creating folder for new_user os.mkdir(data_path+user_name) #Taking photos and storing in folder created u=face.Signup(user_name) if u==1: #Generating Id for new_user user_id=str(uuid.uuid4()) li=[] li.append(user_id) li.append(user_name) li.append(email) #Inserting user data in table ob.insert_user(li) return "" else: return "Try Again"
class Add_transaction(): def __init__(self): self.sq = Sqlite() self.mail = Send_Email() self.sq_trans = Sqlite_trans() def add_transaction(self, user_name, transaction_to, amt, description, transaction_type): if self.sq.find_if_username_exist(transaction_to): print("User found") amount_owe = -1 lis = [] if not amt.isdigit(): return "Invalid input in Amount" elif description == "": return "Details is empty" elif transaction_type == 1 or transaction_type == 2: amount = int(amt) #Generating id for transaction trans_id = str(uuid.uuid4()) if transaction_type == 1: amount_owe = amount else: amount_owe = amount / 2 lis = (trans_id, self.sq.find_id_by_username(user_name), self.sq.find_id_by_username(transaction_to), amount, amount_owe, description, datetime.datetime.now(), 'N') #Storing transaction in table self.sq_trans.insert_transaction(lis) print("transaction done") #Sending mail message = "Detail: " + description + "\nFrom: " + user_name + "\nTotal Amount:" + str( amount) + "\nAmount to pay:" + str(amount_owe) self.mail.send_mail( self.sq.find_email_by_username(transaction_to), user_name, message) print("Message sent") return "" else: return "Invalid input" else: return "User not Found"
def __init__(self): self.sq = Sqlite() try: self.con = sqlite3.connect('mydatabase.db') except Error: print(Error)
from login import Log_in from Add_Transaction import Add_transaction from sqlite_transaction import Sqlite_trans from sqliteHelper import Sqlite import datetime import pandas as pd from functools import partial LARGE_FONT = ("bold", 20) M_FONT = ("Verdana", 12) A_FONT = ("Verdana", 16) sign = Sign_up() log = Log_in() add_t = Add_transaction() sqlite_trans = Sqlite_trans() sq = Sqlite() class Hisaab_kitaab(tk.Tk): def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs) tk.Tk.wm_title(self, "Hisaab-kitaab") container = tk.Frame(self) container.pack(side="top", fill="both", expand=True) container.grid_rowconfigure(0, weight=1) container.grid_columnconfigure(0, weight=1) self.frames = {}
def __init__(self): self.sq = Sqlite() self.mail=Send_Email() self.sq_trans = Sqlite_trans()