From: Edward Delaporte Date: Tue, 14 Apr 2026 04:25:54 +0000 (-0500) Subject: Add invoke tasks X-Git-Url: https://apps.delaporte.us/gitweb/matrix-fridge-bot.git/commitdiff_plain/b6fb57353edbc23f8ae2f0012c0234c9e1d86b0b?ds=sidebyside Add invoke tasks --- diff --git a/matrix_fridge_bot/tasks.py b/matrix_fridge_bot/tasks.py index f95400b..74bb304 100644 --- a/matrix_fridge_bot/tasks.py +++ b/matrix_fridge_bot/tasks.py @@ -7,42 +7,38 @@ from .db import Data # Where to store data DATA_DIR = os.environ.get('MATRIX_DATA_DIR', '') -DB_FILE = os.environ.get('MATRIX_DB_FILE', 'chore.db') +DB_FILE = os.environ.get('MATRIX_DB_FILE', 'fridge.db') db_file = os.path.join(DATA_DIR, DB_FILE) DATA = Data(db_file) @task def add(c, task): + '''Add food to the fridge''' result = DATA.add(task) print(result) @task -def check(c, task): - result = DATA.check(task) - print(result) +def list(c): + '''List good things to eat in the fridge''' + result = DATA.list() + for item in result: + print(f'{item}') -@task -def done(c, task): - result = DATA.done(task) - print(result) @task -def undo(c, task): - result = DATA.undo(task) - print(result) +def to_toss(c): + result = DATA.to_toss() + for item in result: + print(f'{item}') + @task -def remove(c, task): - result = DATA.remove(task) +def remove(c, item): + result = DATA.remove(item) print(result) -@task -def list(c): - result = DATA.list() - for item in result: - print(f'{item}') @task def filter(c, term):