From: Edward Delaporte Date: Sat, 28 Mar 2026 02:08:02 +0000 (-0500) Subject: Fixup X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-chore-bot.git/commitdiff_plain/68b00c8ecbd23b7eed4d0942aa8b45f89f2810e0 Fixup --- diff --git a/matrix_chore_bot/bot.py b/matrix_chore_bot/bot.py index 6d0e502..8a9e755 100644 --- a/matrix_chore_bot/bot.py +++ b/matrix_chore_bot/bot.py @@ -6,13 +6,11 @@ import simplematrixbotlib as botlib from .db import Data as ChoreData - SERVER = os.environ.get('MATRIX_SERVER') BOT_NAME = os.environ.get('MATRIX_BOT') BOT_PWD = os.environ.get('MATRIX_BOT_PWD') -DATA_DIR = os.environ.get('MATRIX_DATA_DIR') -CHORES = ChoreData(os.path.join(DATA_DIR}, 'chores.db')) +CHORES = ChoreData() def get_bot(): creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD) diff --git a/matrix_chore_bot/db.py b/matrix_chore_bot/db.py index c2735e4..315d279 100644 --- a/matrix_chore_bot/db.py +++ b/matrix_chore_bot/db.py @@ -8,8 +8,6 @@ from sqlmodel import Field, Session, SQLModel, create_engine, select, text # - [ ] add Vision FK # - [ ] add notes to each chore -CHORE_DB = os.environ.get('CHORE_DB') - DATE_FORMAT = '%Y-%m-%d' def today(): @@ -38,7 +36,11 @@ def get_chore(session, chore_id): return session.exec(cmd).first() class Data(): - def __init__(self, db_file = CHORE_DB): + def __init__(self, db_file=None): + + if not db_file: + db_file = os.path.join(os.environ.get('MATRIX_DATA_DIR'), 'chores.db') + self.file = db_file self.engine = self.get_engine()