]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/blob - run/drunk_sum.py
Update drunk sum runnable
[hubacji1/coffee-getter.git] / run / drunk_sum.py
1 #!/usr/bin/env python3
2 from sys import argv, exit
3 from coffee_getter.bot import Bot
4
5 SS = {
6     "covfefe": "espresso;espresso lungo;cappuccino;latte macchiato",
7     "coffee": "espresso;espresso lungo;cappuccino;latte macchiato",
8     "mate": "Club-Mate 0,5 l;Club-Mate 0,33 l",
9 }
10
11 if __name__ == "__main__":
12     if len(argv) != 4:
13         print("Usage: PYTHONPATH=. python3 run/drunk_sum.py {} {} {}".format(
14             "\"espresso lungo\"",
15             "\"2010-10-20\"",
16             "\"2020-10-20\""
17         ))
18         print("Or: PYTHONPATH=. python3 run/drunk_sum.py {} {} {}".format(
19             "\"espresso lungo;espresso\"",
20             "\"2010-10-20\"",
21             "\"2020-10-20\""
22         ))
23         print("Or: PYTHONPATH=. python3 run/drunk_sum.py {} {} {}".format(
24             "coffee",
25             "2010-10-20",
26             "2020-10-20"
27         ))
28         print("Instead of beverage real name, you may use:")
29         print("- coffee (for all coffees)")
30         print("- covfefe (equal to coffee)")
31         print("- mate (for all Club-mates)")
32         exit(1)
33     b = Bot()
34     if ";" in argv[1]:
35         b.load_drunk_list(argv[1], argv[2], argv[3])
36     elif argv[1] in SS:
37         b.load_drunk_sum(SS[argv[1]], argv[2], argv[3])
38     else:
39         b.load_drunk_sum(argv[1], argv[2], argv[3])
40     print(b.get_msg())