]>
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
, store_id
, item_id
):
23 result
= Data().assign_store(store_id
, item_id
)
29 result
= Data().purchase_item(item_id
)
33 def clear_all(c
, store_id
):
34 Data().clear_list(store_id
, clear_all
=True)
37 def clear_list(c
, store_id
):
38 Data().clear_list(store_id
)
42 def list(c
, store_id_str
=None):
44 store_id
= int(store_id_str
) if store_id_str
else None
45 items
= Data().get_shopping_list(store_id
)
51 items
= Data().get_stores()
58 items
= Data().get_unsorted_list()
64 def remove_item(c
, item_id
):
65 Data().remove_item(item_id
)
68 def remove_store(c
, store_id
):
69 Data().remove_store(store_id
)