-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcredentials.py
47 lines (37 loc) · 1.11 KB
/
credentials.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
class Credentials:
'''
Class that generates instances for account credentials
'''
credentials_list = []
def save_credentials(self):
'''
This method saves credentials in the credentials_list
'''
Credentials.credentials_list.append(self)
def delete_credentials(self):
'''
This will delete saved credentials from credentials_list
'''
Credentials.credentials_list.remove(self)
@classmethod
def find_credentials(cls, string):
'''
this method accesses credentials in credentials_list
'''
for credential in cls.credentials_list:
if credential.account == string:
return credential
@classmethod
def display_credentials(cls):
'''
method that returns the credentials
'''
return cls.credentials_list
def __init__(self, username, account, acc_credentialsname, acc_password):
'''
Will define properties for this class
'''
self.username = username
self.account = account
self.acc_credentialsname = acc_credentialsname
self.acc_password = acc_password