From 79bed4157538a6997b7fb578ea66151535c482dc Mon Sep 17 00:00:00 2001 From: Simranjot Sandhu Date: Fri, 20 Mar 2020 19:08:35 +0530 Subject: [PATCH] Updated Raw Files --- installation/Pipfile | 2 ++ installation/install.py | 22 +++++++++++++++++----- raw/main.py | 2 +- raw/res/al.py | 1 + raw/res/ap.py | 2 +- raw/res/d.py | 2 +- raw/res/f.py | 9 +++++++-- raw/res/m.py | 11 ++++++----- raw/res/s.py | 18 +++++++++++++++--- 9 files changed, 51 insertions(+), 18 deletions(-) diff --git a/installation/Pipfile b/installation/Pipfile index 2d10bb9..4158259 100644 --- a/installation/Pipfile +++ b/installation/Pipfile @@ -6,6 +6,8 @@ name = "pypi" [dev-packages] [packages] +tkinter +re [requires] python_version = "3.6" diff --git a/installation/install.py b/installation/install.py index 603fbcb..9793284 100644 --- a/installation/install.py +++ b/installation/install.py @@ -49,7 +49,7 @@ def installFolder(folder): f.LogStartUp() # Check if the modules work or not. -print("Application started. This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester.") +print("Application started. This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester and Collaborated by Simranjot Sandhu ( HEC, Jagadhri)).") # 0n the launch, we will check if the application was already launched or not by viewing our data fileset. # TODO: Install the res folder along with the files, and empty bin folder @@ -673,7 +673,7 @@ def decryptHandler(pwd): # This fucntion adds our signature def showSignature(): - text='This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester.' + text='This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester and Collaborated by Simranjot Sandhu ( HEC, Jagadhri)).' return text @@ -794,6 +794,8 @@ def exitWindow(*event): from tkinter import * import tkinter as tk from tkinter import scrolledtext as st +from tkinter import messagebox as mb +import re import f import m @@ -833,12 +835,22 @@ def showWindow(): # nameE.grid(row=1, column=1) # You know what this does now :D pwordE = Entry(roots, show='*') # Same as above, yet 'show="*"' What this does is replace the text with *, like a password box :D pwordE.grid(row=5, column=1) # ^^ - signupButton = Button(roots, text='Continue', fg="green", command=storeGlobalPwd) # This creates the button with the text 'signup', when you click it, the command 'fssignup' will run. which is the def + signupButton = Button(roots, text='Continue', fg="green", command=strongPass) # This creates the button with the text 'signup', when you click it, the command 'fssignup' will run. which is the def + roots.bind('',lambda event: strongPass()) signupButton.grid(row=5,column=3, sticky=W) roots.mainloop() # This just makes the window keep open, we will destroy it soon #nameE.get() +def strongPass(): + pattern = '^(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$' + passwd = pwordE.get() + if re.match(pattern,passwd): + storeGlobalPwd() + else: + mb.showwarning("warning","Password should contain at least 1 capital letter, 1 small letter, 1 number and 8 character length") + + def storeGlobalPwd(): import ap import m @@ -851,7 +863,7 @@ def storeGlobalPwd(): # This fucntion adds our signature def showSignature(): - text = 'This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester.' + text = 'This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester and Collaborated by Simranjot Sandhu ( HEC, Jagadhri)).' return text # This function displays the about @@ -879,7 +891,7 @@ def exitWindow(*event): # Start installing the files print( - "This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester.") + "This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester and Collaborated by Simranjot Sandhu ( HEC, Jagadhri)).") print("Creating directories...") installFolder("Password Keeper") installFolder("Password Keeper/bin") diff --git a/raw/main.py b/raw/main.py index 424f29f..4d3d9bc 100644 --- a/raw/main.py +++ b/raw/main.py @@ -20,7 +20,7 @@ f.LogStartUp() # Check if the modules work or not. -print("Application started. This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester.") +print("Application started. This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester and Collaborated by Simranjot Sandhu ( HEC, Jagadhri)).") # 0n the launch, we will check if the application was already launched or not by viewing our data fileset. # TODO: Install the res folder along with the files, and empty bin folder diff --git a/raw/res/al.py b/raw/res/al.py index f0d9329..c75a6b4 100644 --- a/raw/res/al.py +++ b/raw/res/al.py @@ -1,4 +1,5 @@ + # made with love by Aekansh Dixit (https://github.com/aekanshd/) # Please credit me in all your future updates, that's all - you're free to use this code commercially, too. # (c) Aekansh Dixit, 2018 provided under The MIT License (https://opensource.org/licenses/MIT) diff --git a/raw/res/ap.py b/raw/res/ap.py index 541bd3e..550f1ab 100644 --- a/raw/res/ap.py +++ b/raw/res/ap.py @@ -94,4 +94,4 @@ def checkPassword(pwd): return False except IOError as e: f.Log(e, "checkPassword") - return False \ No newline at end of file + return False diff --git a/raw/res/d.py b/raw/res/d.py index 2744c9d..1c06e19 100644 --- a/raw/res/d.py +++ b/raw/res/d.py @@ -96,4 +96,4 @@ def deleteAccount(id): accounts.pop(id,None) writeData(f.DICTtoJSON(accounts)) f.Log("Account deleted: " + id, "deleteAccount") - return True \ No newline at end of file + return True diff --git a/raw/res/f.py b/raw/res/f.py index 911f470..4bed73e 100644 --- a/raw/res/f.py +++ b/raw/res/f.py @@ -26,7 +26,12 @@ def Log(thrown_error, by): # Log applications startups def LogStartUp(): f = open("bin/logs.txt", "a+") - f.write("\n=============================================\n\nApplication Started at "+str(datetime.datetime.now())+ "\n\n") + f.write("\ +=============================================\ +\ +Application Started at "+str(datetime.datetime.now())+ "\ +\ +") f.close() @@ -86,4 +91,4 @@ def createDataFile(): return True except IOError as e: Log(e, "createDataFile") - return False \ No newline at end of file + return False diff --git a/raw/res/m.py b/raw/res/m.py index 1662926..b00773a 100644 --- a/raw/res/m.py +++ b/raw/res/m.py @@ -1,4 +1,5 @@ + # made with love by Aekansh Dixit (https://github.com/aekanshd/) # Please credit me in all your future updates, that's all - you're free to use this code commercially, too. # (c) Aekansh Dixit, 2018 provided under The MIT License (https://opensource.org/licenses/MIT) @@ -190,9 +191,9 @@ def displayAccounts(): deleteBtn = Button(roots, text='Delete Account', command=lambda key=key: deleteEntryHandler(key)) deleteBtn.grid(row=row, column=3, padx=10, sticky=E) else: - deleteBtn = Button(roots, text='Delete Account', command=lambda key=key: deleteAccount(key)) + deleteBtn = Button(roots, text='Delete Account', command=lambda key=key: deleteEntryHandler(key)) deleteBtn.grid(row=row, column=3, padx=10, sticky=E) - + row += 1 @@ -225,7 +226,7 @@ def viewDetails(id): pwdTL = Label(detailsWindow, text=password) pwdTL.grid(row=2, column=1, sticky=W) - + if not unlocked: detailsGapL = Label(detailsWindow, text='\n', justify=LEFT) detailsGapL.grid(row=3, column=0, columnspan=4, sticky=W) @@ -246,7 +247,7 @@ def viewDetails(id): loginPwdBtn.grid(row=6, column=5, columnspan=4, sticky=E) detailsGapL2 = Label(detailsWindow, text='\n\n') detailsGapL2.grid(row=7, column=0, columnspan=2, sticky=W) - + # This function confirms the deletion password @@ -273,7 +274,7 @@ def decryptHandler(pwd): # This fucntion adds our signature def showSignature(): - text='This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester.' + text='This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester and Collaborated by Simranjot Sandhu ( HEC, Jagadhri)).' return text diff --git a/raw/res/s.py b/raw/res/s.py index bc5bf4d..089b730 100644 --- a/raw/res/s.py +++ b/raw/res/s.py @@ -8,6 +8,8 @@ from tkinter import * import tkinter as tk from tkinter import scrolledtext as st +from tkinter import messagebox as mb +import re import f import m @@ -23,7 +25,7 @@ def showWindow(): roots.title('Password Keeper') # This renames the title of said window to 'signup' roots.geometry('500x200') roots.resizable(0,0) - + #this creates a menu menubar = tk.Menu(roots) roots.config(menu=menubar) @@ -47,12 +49,22 @@ def showWindow(): # nameE.grid(row=1, column=1) # You know what this does now :D pwordE = Entry(roots, show='*') # Same as above, yet 'show="*"' What this does is replace the text with *, like a password box :D pwordE.grid(row=5, column=1) # ^^ - signupButton = Button(roots, text='Continue', fg="green", command=storeGlobalPwd) # This creates the button with the text 'signup', when you click it, the command 'fssignup' will run. which is the def + signupButton = Button(roots, text='Continue', fg="green", command=strongPass) # This creates the button with the text 'signup', when you click it, the command 'fssignup' will run. which is the def + roots.bind('',lambda event: strongPass()) signupButton.grid(row=5,column=3, sticky=W) roots.mainloop() # This just makes the window keep open, we will destroy it soon #nameE.get() +def strongPass(): + pattern = '^(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$' + passwd = pwordE.get() + if re.match(pattern,passwd): + storeGlobalPwd() + else: + mb.showwarning("warning","Password should contain at least 1 capital letter, 1 small letter, 1 number and 8 character length") + + def storeGlobalPwd(): import ap import m @@ -65,7 +77,7 @@ def storeGlobalPwd(): # This fucntion adds our signature def showSignature(): - text = 'This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester.' + text = 'This project was made by Aekansh Dixit (First Year Student of PES University, Bengaluru) for the Python Project Assignments of the first semester and Collaborated by Simranjot Sandhu ( HEC, Jagadhri)).' return text # This function displays the about