X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-chore-bot.git/blobdiff_plain/96d01de852abf2944122075f954feb7aa536f0e4..552766bf792d796ff8986234a7380dca47172e08:/matrix_chore_bot/db.py diff --git a/matrix_chore_bot/db.py b/matrix_chore_bot/db.py index 8467d32..b4d3374 100644 --- a/matrix_chore_bot/db.py +++ b/matrix_chore_bot/db.py @@ -13,6 +13,8 @@ DATE_FORMAT = '%Y-%m-%d' def today(): return dt.now().strftime(DATE_FORMAT) +DEFAULT_DB_FILE = os.path.join(os.environ.get('MATRIX_DATA_DIR', ''), 'chores.db') +DB_FILE = os.environ.get('MATRIX_CHORE_DB_FILE', DEFAULT_DB_FILE) logger = logging.getLogger(__name__) logging.basicConfig(filename='chore.log', encoding='utf-8', level=logging.DEBUG) @@ -39,7 +41,7 @@ class Data(): def __init__(self, db_file=None): if not db_file: - db_file = os.path.join(os.environ.get('MATRIX_DATA_DIR', ''), 'chores.db') + db_file = DB_FILE self.file = db_file self.engine = self.get_engine()