]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/blobdiff - run/drunk_sum.py
Add Club-mate shortcut to drunk sum runnable
[hubacji1/coffee-getter.git] / run / drunk_sum.py
index ef683fcd249f75b934e61f830cbf3c43b1afa9de..eeec196ecd112adfe8a12dde886908cc29805eea 100755 (executable)
@@ -7,23 +7,35 @@ from cbgetter import CoffeebotGetter
 SS = {
     "covfefe": "espresso;espresso lungo;cappuccino;latte macchiato",
     "coffee": "espresso;espresso lungo;cappuccino;latte macchiato",
+    "mate": "Club-Mate 0,5 l;Club-Mate 0,33 l",
 }
 
 if __name__ == "__main__":
     if len(argv) != 4:
-        print("Usage: python3 drunk_sum.py {} {} {}".format(
+        print("Usage: PYTHONPATH=. python3 run/drunk_sum.py {} {} {}".format(
             "\"espresso lungo\"",
             "\"2010-10-20\"",
             "\"2020-10-20\""
         ))
-        print("Or: python3 drunk_sum.py {} {} {}".format(
+        print("Or: PYTHONPATH=. python3 run/drunk_sum.py {} {} {}".format(
             "\"espresso lungo;espresso\"",
             "\"2010-10-20\"",
             "\"2020-10-20\""
         ))
+        print("Or: PYTHONPATH=. python3 run/drunk_sum.py {} {} {}".format(
+            "coffee",
+            "2010-10-20",
+            "2020-10-20"
+        ))
+        print("Instead of beverage real name, you may use:")
+        print("- coffee (for all coffees)")
+        print("- covfefe (equal to coffee)")
+        print("- mate (for all Club-mates)")
         exit(1)
     g = CoffeebotGetter()
-    if argv[1] in SS:
+    if ";" in argv[1]:
+        g.loadDrunkList(argv[1], argv[2], argv[3])
+    elif argv[1] in SS:
         g.loadDrunkSum(SS[argv[1]], argv[2], argv[3])
     else:
         g.loadDrunkSum(argv[1], argv[2], argv[3])