]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/commitdiff
Rework conf
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Fri, 4 Nov 2022 11:16:09 +0000 (12:16 +0100)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Fri, 4 Nov 2022 15:02:06 +0000 (16:02 +0100)
.cfg [deleted file]
coffee_getter/conf.py

diff --git a/.cfg b/.cfg
deleted file mode 100644 (file)
index a287dba..0000000
--- a/.cfg
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "coffeebot": {
-        "url": "https://hooks.slack.com/services/..."
-    },
-    "coffeedb": {
-        "path": "./coffee.db"
-    }
-}
index 7695cd405ac782314bdbbf46dd152cff94c1a604..62c2df95d6f7f3de5c1e1923895e99c074e8855c 100644 (file)
@@ -1,20 +1,3 @@
-# -*- coding: utf-8 -*-
-"""Get configuration."""
-from json import loads
-from os.path import dirname, abspath
-
-class Conf:
-    PATH = "{}/.cfg".format(dirname(abspath(__file__)))
-
-    def __init__(self):
-        with open(Conf.PATH) as f:
-            self.conf = loads(f.read())
-        return None
-
-    def getCoffeebotURL(self):
-        """Return URL of Slack Coffeebot."""
-        return self.conf["coffeebot"]["url"]
-
-    def getCoffeeDbPath(self):
-        """Return the path to database with coffees."""
-        return self.conf["coffeedb"]["path"]
+TESTCOFFEEBOT_SLACK_URL = "..."
+COFFEEBOT_SLACK_URL = "..."
+DB_PATH = "./coffee.db"