mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-10-31 22:47:05 +01:00
Config: allow multiple config topics
Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
parent
6fc923a371
commit
1e5f7c3ec4
@ -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:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[doorlock]
|
[doorlockd]
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
SIMULATE_SERIAL = False
|
SIMULATE_SERIAL = False
|
||||||
|
@ -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'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user