]>
us-delaporte.pagekite.me Git - matrix-shop-bot.git/blob - matrix_shop_bot/tasks.py
1 from invoke
import task
7 result
= Data().setup()
11 def add_item(c
, name
):
12 result
= Data().add_item(name
)
16 def add_store(c
, name
):
17 result
= Data().add_store(name
)
22 def assign(c
, item_id
):
23 result
= Data().assign_last_store(item_id
)
28 def assign_to_store(c
, item_id
, store_id
):
29 result
= Data().assign_store(store_id
, item_id
)
35 result
= Data().purchase_item(item_id
)
39 def clear_all(c
, store_id
):
40 Data().clear_list(store_id
, clear_all
=True)
43 def clear_list(c
, store_id
):
44 Data().clear_list(store_id
)
48 def list_for_store(c
, store_id
):
49 items
= Data().get_shopping_list_for_store(store_id
)
56 '''Use previous store'''
57 items
= Data().get_last_shopping_list()
63 items
= Data().get_stores()
70 items
= Data().get_unsorted_list()
76 def remove_item(c
, item_id
):
77 Data().remove_item(item_id
)
80 def remove_store(c
, store_id
):
81 Data().remove_store(store_id
)