diff options
author | Christian Cleberg <hello@cleberg.net> | 2024-11-06 21:08:07 -0600 |
---|---|---|
committer | Christian Cleberg <hello@cleberg.net> | 2024-11-06 21:08:07 -0600 |
commit | 00eaf465f1f4bb3b90285f145b21f6e2f3e4d8ca (patch) | |
tree | 77ff270689090cb41c1c6e92bf735bcd06568d6a /account.py | |
parent | 83126f2a2b88bd0e231e8f49d0ca0cbd02f4326f (diff) | |
download | yoshi-cli-00eaf465f1f4bb3b90285f145b21f6e2f3e4d8ca.tar.gz yoshi-cli-00eaf465f1f4bb3b90285f145b21f6e2f3e4d8ca.tar.bz2 yoshi-cli-00eaf465f1f4bb3b90285f145b21f6e2f3e4d8ca.zip |
mv Account.py to account.py
Diffstat (limited to 'account.py')
-rw-r--r-- | account.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/account.py b/account.py new file mode 100644 index 0000000..8920b13 --- /dev/null +++ b/account.py @@ -0,0 +1,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 |