-
Notifications
You must be signed in to change notification settings - Fork 0
/
Account.py
43 lines (34 loc) · 1.21 KB
/
Account.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
"""
This script imports necessary modules for database interactions.
Modules imported:
- database: A custom module providing database functionality.
"""
import database
class Account:
"""Represents a login account."""
def __init__(self, uuid: str, application: str, username: str,
password: str, url: str) -> None:
self.self = self
self.uuid = uuid
self.application = application
self.username = username
self.password = password
self.url = url
def display_account(self) -> None:
"""Print the account details."""
print('ID:', self.uuid)
print('Application:', self.application)
print('Username:', self.username)
print('Password:', self.password)
print('URL:', self.url)
def save_account(self) -> None:
"""Save the account details to the database."""
database.add_account(
self.uuid, self.application, self.username, self.password, self.url)
def delete_account(self) -> bool:
"""Delete the account from the database.
Returns:
bool: True if the deletion was successful.
"""
database.delete_account(self.uuid)
return True