summaryrefslogtreecommitdiff
path: root/yoshi/account.py
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2024-11-06 23:23:27 -0600
committerChristian Cleberg <hello@cleberg.net>2024-11-06 23:23:27 -0600
commit6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c (patch)
tree6cf4b78ddd63a4606e19fcad423ed2e19ad2a268 /yoshi/account.py
parentb5a5fadff88615c8da8a9feb80c86fd8adb238f5 (diff)
downloadyoshi-cli-6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c.tar.gz
yoshi-cli-6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c.tar.bz2
yoshi-cli-6dde4dd0bc5e5f91f89587c75a30c9ef7a24494c.zip
package as a cli app
Diffstat (limited to 'yoshi/account.py')
-rw-r--r--yoshi/account.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/yoshi/account.py b/yoshi/account.py
new file mode 100644
index 0000000..bf97c23
--- /dev/null
+++ b/yoshi/account.py
@@ -0,0 +1,43 @@
+"""
+This script imports necessary modules for database interactions.
+
+Modules imported:
+ - database: A custom module providing database functionality.
+"""
+
+import yoshi.database as database
+
+
+class Account:
+ """Represents a login account."""
+
+ def __init__(self, uuid: str, application: str, #pylint: disable=R0913,R0917
+ username: str, #pylint: disable=R0913,R0917
+ password: str, url: str) -> None: #pylint: disable=R0913,R0917
+ 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