1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 02:14:26 +01:00

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_fmt = '%(asctime)-15s %(levelname)-8s %(message)s'
log = logging.getLogger() log = logging.getLogger()
cfg = Config(SYSCONFDIR) cfg = Config(SYSCONFDIR, 'doorlockd')
class Logic: class Logic:

View File

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

View File

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