X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-shop-bot.git/blobdiff_plain/dc9596331e7950ed257dd0e0ccffd36590ab8cc0..2fe28d1dc4ee451541c9f4e921b5c6eb71e91aed:/matrix_shop_bot/tasks.py?ds=sidebyside diff --git a/matrix_shop_bot/tasks.py b/matrix_shop_bot/tasks.py index a60a2a1..29911a9 100644 --- a/matrix_shop_bot/tasks.py +++ b/matrix_shop_bot/tasks.py @@ -19,14 +19,20 @@ def add_store(c, name): @task -def assign(c, store_id, item_id): +def assign(c, item_id): + result = Data().assign_last_store(item_id) + print(result) + + +@task +def assign_to_store(c, item_id, store_id): result = Data().assign_store(store_id, item_id) print(result) @task -def buy(c, item_id): - result = Data().purchase_item(item_id) +def buy(c, items): + result = Data().purchase_items(items) print(result) @task @@ -39,8 +45,16 @@ def clear_list(c, store_id): @task -def list(c, store_id): - items = Data().get_shopping_list(store_id) +def list_for_store(c, store_id): + items = Data().get_shopping_list_for_store(store_id) + for item in items: + print(item) + + +@task +def list(c): + '''Use previous store''' + items = Data().get_last_shopping_list() for item in items: print(item)