X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-fridge-bot.git/blobdiff_plain/968d6f8358f64ba4f4f09cb8948d643c57022c9d..b6fb57353edbc23f8ae2f0012c0234c9e1d86b0b:/matrix_fridge_bot/tasks.py?ds=sidebyside 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):