]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/blob - cbconf.py
Update test database
[hubacji1/coffee-getter.git] / cbconf.py
1 # -*- coding: utf-8 -*-
2 """Get configuration."""
3 from json import loads
4 from os.path import dirname, abspath
5
6 class Conf:
7     PATH = "{}/.cfg".format(dirname(abspath(__file__)))
8
9     def __init__(self):
10         with open(Conf.PATH) as f:
11             self.conf = loads(f.read())
12         return None
13
14     def getCoffeebotURL(self):
15         """Return URL of Slack Coffeebot."""
16         return self.conf["coffeebot"]["url"]
17
18     def getCoffeeDbPath(self):
19         """Return the path to database with coffees."""
20         return self.conf["coffeedb"]["path"]