X-Git-Url: https://apps.delaporte.us/gitweb/matrix-chore-bot.git/blobdiff_plain/145745886f1614e292c17163884e15e669dcf224..HEAD:/matrix_chore_bot/db.py diff --git a/matrix_chore_bot/db.py b/matrix_chore_bot/db.py index 1a07bec..a0eae22 100644 --- a/matrix_chore_bot/db.py +++ b/matrix_chore_bot/db.py @@ -35,14 +35,14 @@ def get_chore(session, chore_id): return session.exec(cmd).first() class Data(): - def __init__(self, db_file=None): - - if not db_file: - db_file = DB_FILE + def __init__(self, db_file): self.file = db_file self.engine = self.get_engine() + def get_db_file(self): + return self.file + def get_engine(self): return create_engine(f"sqlite:///{self.file}")