]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/blob - run/drunk_sum.py
Add drunk sum shortcuts
[hubacji1/coffee-getter.git] / run / drunk_sum.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 """Print drunk drink in time period."""
4 from sys import argv, exit
5 from cbgetter import CoffeebotGetter
6
7 SS = {
8     "covfefe": "espresso;espresso lungo;cappuccino;latte macchiato",
9     "coffee": "espresso;espresso lungo;cappuccino;latte macchiato",
10 }
11
12 if __name__ == "__main__":
13     if len(argv) != 4:
14         print("Usage: python3 drunk_sum.py {} {} {}".format(
15             "\"espresso lungo\"",
16             "\"2010-10-20\"",
17             "\"2020-10-20\""
18         ))
19         print("Or: python3 drunk_sum.py {} {} {}".format(
20             "\"espresso lungo;espresso\"",
21             "\"2010-10-20\"",
22             "\"2020-10-20\""
23         ))
24         exit(1)
25     g = CoffeebotGetter()
26     if argv[1] in SS:
27         g.loadDrunkSum(SS[argv[1]], argv[2], argv[3])
28     else:
29         g.loadDrunkSum(argv[1], argv[2], argv[3])
30     print(g.getMsg())