-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpassLocker.py
More file actions
106 lines (72 loc) · 2 KB
/
Copy pathpassLocker.py
File metadata and controls
106 lines (72 loc) · 2 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import pyperclip
class Credential:
cred_list=[]
'''
class that generates new instance of contacts
'''
def __init__(self, uname, passwrd):
'''
'''
self.uname=uname
self.passwrd=passwrd
def save_creds(self):
'''
'''
Credential.cred_list.append(self)
@classmethod
def creds_exist(cls,uname):
'''
Method that checks if the username exist
'''
for credential in cls.cred_list:
if credential.uname==uname:
return True
return False
@classmethod
def authenticate_creds(cls, uname, passwrd):
'''
Method that checks if the username and password are correct
'''
for cred in cls.cred_list:
if cred.uname == uname and cred.passwrd == passwrd:
return cred
return 0
class UserData:
'''
class that generates new instance of user data
'''
user_data_list = []
user_data_list2 = str(user_data_list)
def __init__(self, acc_name,acc_username, acc_password):
'''
'''
self.acc_name = acc_name
self.acc_username = acc_username
self.acc_password = acc_password
def create_password(self):
'''
creates a passord and acc name
'''
return UserData.user_data_list.append(self)
@classmethod
def show_user_data(cls):
'''
Displays all passwords and other acc details
'''
return cls.user_data_list
@classmethod
def find_by_acc_name(cls, acc_name):
'''
Finds user data using the user acc name
'''
for found in cls.user_data_list2:
if found == acc_name:
return found
@classmethod
def data_exists(cls, acc_name):
'''
Checks if data exists
'''
for data in cls.user_data_list:
if data.acc_name == acc_name:
return data