diff --git a/doorlockd b/doorlockd index df5db9b..dbb6a73 100755 --- a/doorlockd +++ b/doorlockd @@ -39,6 +39,9 @@ from wtforms.validators import DataRequired, Length SYSCONFDIR = '.' PREFIX = '.' +root_prefix = join(PREFIX, 'share', 'doorlockd') +sounds_prefix = join(root_prefix, 'sounds') + __author__ = 'Ralf Ramsauer' __copyright = 'Copyright (c) Ralf Ramsauer, 2018' __license__ = 'GPLv2' @@ -76,12 +79,13 @@ if 'LDAP_CA' in webapp.config.keys(): ldap_uri = webapp.config.get('LDAP_URI') ldap_binddn = webapp.config.get('LDAP_BINDDN') -wave_emergency = webapp.config.get('WAVE_EMERGENCY') -wave_lock = webapp.config.get('WAVE_LOCK') -wave_lock_button = webapp.config.get('WAVE_LOCK_BUTTON') -wave_unlock = webapp.config.get('WAVE_UNLOCK') -wave_unlock_button = webapp.config.get('WAVE_UNLOCK_BUTTON') -wave_zonk = webapp.config.get('WAVE_ZONK') +wave_emergency = 'emergency_unlock.wav' +wave_lock = 'lock.wav' +wave_lock_button = 'lock_button.wav' +wave_unlock = 'unlock.wav' +wave_unlock_button = 'unlock_button.wav' +wave_zonk = 'zonk.wav' + sounds = webapp.config.get('SOUNDS') host = 'localhost' @@ -118,7 +122,7 @@ def choose_insult(): def playsound(filename): if not sounds: return - Popen(['nohup', 'aplay', filename]) + Popen(['nohup', 'aplay', join(sounds_prefix, filename)]) def start_hook(script): diff --git a/doorlockd.cfg b/doorlockd.cfg index b09cbfd..75607cd 100644 --- a/doorlockd.cfg +++ b/doorlockd.cfg @@ -12,10 +12,3 @@ LDAP_BINDDN = 'cn=%s,ou=people,dc=binary-kitchen,dc=de' BOOTSTRAP_SERVE_LOCAL = True SERIAL_PORT = '/dev/ttyAMA0' - -WAVE_EMERGENCY = './sounds/emergency_unlock.wav' -WAVE_LOCK = './sounds/lock.wav' -WAVE_LOCK_BUTTON = './sounds/lock_button.wav' -WAVE_UNLOCK = './sounds/unlock.wav' -WAVE_UNLOCK_BUTTON = './sounds/unlock_button.wav' -WAVE_ZONK = './sounds/zonk.wav' diff --git a/sounds/emergency_unlock.wav b/share/doorlockd/sounds/emergency_unlock.wav similarity index 100% rename from sounds/emergency_unlock.wav rename to share/doorlockd/sounds/emergency_unlock.wav diff --git a/sounds/lock.wav b/share/doorlockd/sounds/lock.wav similarity index 100% rename from sounds/lock.wav rename to share/doorlockd/sounds/lock.wav diff --git a/sounds/lock_button.wav b/share/doorlockd/sounds/lock_button.wav similarity index 100% rename from sounds/lock_button.wav rename to share/doorlockd/sounds/lock_button.wav diff --git a/sounds/unlock.wav b/share/doorlockd/sounds/unlock.wav similarity index 100% rename from sounds/unlock.wav rename to share/doorlockd/sounds/unlock.wav diff --git a/sounds/unlock_button.wav b/share/doorlockd/sounds/unlock_button.wav similarity index 100% rename from sounds/unlock_button.wav rename to share/doorlockd/sounds/unlock_button.wav diff --git a/sounds/zonk.wav b/share/doorlockd/sounds/zonk.wav similarity index 100% rename from sounds/zonk.wav rename to share/doorlockd/sounds/zonk.wav