]> apps.delaporte.us Git - matrix-fridge-bot.git/blobdiff - matrix_fridge_bot/tasks.py
Ignore stray db files
[matrix-fridge-bot.git] / matrix_fridge_bot / tasks.py
index f95400b6ef15ce35e39c54553c3c3ec95c6cb9cd..c51eca161a09e6a00e65bdd9ec1678b982efb7f4 100644 (file)
@@ -7,43 +7,46 @@ 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)
+def setup(c):
+    '''One time database setup.'''
+    result = DATA.setup()
     print(result)
 
-@task
-def done(c, task):
-    result = DATA.done(task)
-    print(result)
 
-@task
-def undo(c, task):
-    result = DATA.undo(task)
-    print(result)
-
-@task
-def remove(c, task):
-    result = DATA.remove(task)
-    print(result)
 
 @task
 def list(c):
+    '''List good things to eat in the fridge'''
     result = DATA.list()
     for item in result:
         print(f'{item}')
 
+
+@task
+def toss(c):
+    result = DATA.to_toss()
+    for item in result:
+        print(f'{item}')
+
+
+@task
+def remove(c, item):
+    result = DATA.remove(item)
+    print(result)
+
+
 @task
 def filter(c, term):
     result = DATA.filter(term)