X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-shop-bot.git/blobdiff_plain/d0f8d69f2d4aa2a1af67baae391663d9bb72c729..895434f80adf39e2122f592c09a8ade36209a8a7:/matrix_shop_bot/tasks.py?ds=sidebyside diff --git a/matrix_shop_bot/tasks.py b/matrix_shop_bot/tasks.py index 1fbc3fb..54cafd1 100644 --- a/matrix_shop_bot/tasks.py +++ b/matrix_shop_bot/tasks.py @@ -17,13 +17,31 @@ def add_store(c, name): result = Data().add_store(name) print(result) + +@task +def assign(c, store_id, item_id): + result = Data().assign_store(store_id, item_id) + print(result) + + @task def buy(c, item_id): result = Data().purchase_item(item_id) print(result) @task -def list(c, store_id): +def clear_all(c, store_id): + Data().clear_list(store_id, clear_all=True) + +@task +def clear_list(c, store_id): + Data().clear_list(store_id) + + +@task +def list(c, store_id_str=None): + + store_id = int(store_id_str) if store_id_str else None items = Data().get_shopping_list(store_id) for item in items: print(item) @@ -34,13 +52,6 @@ def list_stores(c): for item in items: print(item) -@task -def clear_list(c, store_id): - Data().clear_list(store_id) - -@task -def clear_all(c, store_id): - Data().clear_list(store_id, clear_all=True) @task def list_unsorted(c): @@ -48,9 +59,12 @@ def list_unsorted(c): for item in items: print(item) + @task -def assign(c, store_id, item_id): - result = Data().assign_store(store_id, item_id) - print(result) +def remove_item(c, item_id): + Data().remove_item(item_id) +@task +def remove_store(c, store_id): + Data().remove_store(store_id)