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)
# - [ ] add Vision FK
# - [ ] add notes to each chore
-CHORE_DB = os.environ.get('CHORE_DB')
-
DATE_FORMAT = '%Y-%m-%d'
def today():
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()