]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/commitdiff
Add drunk sum shortcuts
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 4 Apr 2019 05:25:28 +0000 (07:25 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 4 Apr 2019 05:25:28 +0000 (07:25 +0200)
CHANGELOG.md
run/drunk_sum.py

index 227e0573bcc6f67b52e1d635575770f80d5b5fed..3a47cd6d011897a1d8e659ba84bb088dabf00c92 100644 (file)
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog][] and this project adheres to
 ## Unreleased
 ### Added
 - Support for multiple drinks in `drunk_sum` runnable.
+- Sum all the coffees by one command.
 
 ## 0.2.1 - 2019-04-03
 ### Fixed
index 004d98e8537d646769aff8b247684fab1e64e562..ef683fcd249f75b934e61f830cbf3c43b1afa9de 100755 (executable)
@@ -4,6 +4,11 @@
 from sys import argv, exit
 from cbgetter import CoffeebotGetter
 
+SS = {
+    "covfefe": "espresso;espresso lungo;cappuccino;latte macchiato",
+    "coffee": "espresso;espresso lungo;cappuccino;latte macchiato",
+}
+
 if __name__ == "__main__":
     if len(argv) != 4:
         print("Usage: python3 drunk_sum.py {} {} {}".format(
@@ -18,5 +23,8 @@ if __name__ == "__main__":
         ))
         exit(1)
     g = CoffeebotGetter()
-    g.loadDrunkSum(argv[1], argv[2], argv[3])
+    if argv[1] in SS:
+        g.loadDrunkSum(SS[argv[1]], argv[2], argv[3])
+    else:
+        g.loadDrunkSum(argv[1], argv[2], argv[3])
     print(g.getMsg())