Config: allow multiple config topics

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2019-06-15 19:54:37 +02:00
parent 6fc923a371
commit 1e5f7c3ec4
3 changed files with 4 additions and 5 deletions

View File

@ -44,7 +44,7 @@ date_fmt = '%Y-%m-%d %H:%M:%S'
log_fmt = '%(asctime)-15s %(levelname)-8s %(message)s'
log = logging.getLogger()
cfg = Config(SYSCONFDIR)
cfg = Config(SYSCONFDIR, 'doorlockd')
class Logic:

View File

@ -1,4 +1,4 @@
[doorlock]
[doorlockd]
DEBUG = False
SIMULATE_SERIAL = False

View File

@ -32,9 +32,8 @@ def check_exists(func):
class Config:
config_topic = 'doorlock'
def __init__(self, sysconfdir):
def __init__(self, sysconfdir, config_topic):
self.config_topic = config_topic
self.config = ConfigParser()
self.config.read(join(sysconfdir, 'doorlockd.cfg'))