From c2c6e00651faadac69d530c4e0d9702dd37de2a3 Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Wed, 5 Sep 2018 19:26:38 +0000 Subject: [PATCH] Rename config.cfg -> doorlockd.cfg Signed-off-by: Ralf Ramsauer --- doorlockd | 6 +++++- config.cfg => doorlockd.cfg | 0 2 files changed, 5 insertions(+), 1 deletion(-) rename config.cfg => doorlockd.cfg (100%) diff --git a/doorlockd b/doorlockd index 26f5c79..df5db9b 100755 --- a/doorlockd +++ b/doorlockd @@ -22,6 +22,7 @@ import logging import sys from enum import Enum +from os.path import join from random import sample from serial import Serial from subprocess import Popen @@ -35,6 +36,9 @@ from flask_wtf import FlaskForm from wtforms import PasswordField, StringField, SubmitField from wtforms.validators import DataRequired, Length +SYSCONFDIR = '.' +PREFIX = '.' + __author__ = 'Ralf Ramsauer' __copyright = 'Copyright (c) Ralf Ramsauer, 2018' __license__ = 'GPLv2' @@ -56,7 +60,7 @@ default_binddn = 'cn=%s,ou=people,dc=binary-kitchen,dc=de' html_title = 'Binary Kitchen Doorlock (%s - v%s)' % (__status__, __version__) webapp = Flask(__name__) -webapp.config.from_pyfile('config.cfg') +webapp.config.from_pyfile(join(SYSCONFDIR, 'doorlockd.cfg')) socketio = SocketIO(webapp, async_mode='threading') Bootstrap(webapp) serial_port = webapp.config.get('SERIAL_PORT') diff --git a/config.cfg b/doorlockd.cfg similarity index 100% rename from config.cfg rename to doorlockd.cfg