X-Git-Url: https://apps.delaporte.us/gitweb/matrix-shop-bot.git/blobdiff_plain/61e15eca3a7832fb762ab0e7295b2e235b0e093b..a9b30b0237bf81c889c2a90d31c1e6d7edbd9973:/matrix_shop_bot/tasks.py?ds=sidebyside diff --git a/matrix_shop_bot/tasks.py b/matrix_shop_bot/tasks.py index 52484a0..61bd5b7 100644 --- a/matrix_shop_bot/tasks.py +++ b/matrix_shop_bot/tasks.py @@ -33,6 +33,10 @@ def assign_to_store(c, item_id, store_id): result = Data().assign_store(store_id, item_id) print(result) +@task +def item_to_zone(c, item, zone): + result = Data().assign_zone(item, zone) + print(result) @task def buy(c, items): @@ -46,21 +50,19 @@ def list_bought(c, store): print(str(item)) @task -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) +def clear(c, store_name, clear_all=False): + results = Data().clear_list(store_name, clear_all) + for item in results: + print(str(item)) @task -def list_for_store(c, store_id): - items = Data().get_shopping_list_for_store(store_id) +def at(c, store_name): + '''Select store to shop at''' + items = Data().get_shopping_list(store_name) for item in items: print(item) - @task def list(c): '''Use previous store''' @@ -90,3 +92,9 @@ def remove_item(c, item_id): def remove_store(c, store_id): Data().remove_store(store_id) +@task +def list_purchases(c, store): + items = Data().list_purchases(store) + for item in items: + print(item) +