Allow shutting down using KeyboardInterrupt

This commit is contained in:
Ewoud Kohl van Wijngaarden
2012-10-29 10:43:03 +01:00
parent 2fb45f489a
commit 34b162877e

View File

@@ -140,7 +140,10 @@ def main():
while True:
if not headphones.SIGNAL:
time.sleep(1)
try:
time.sleep(1)
except KeyboardInterrupt:
headphones.SIGNAL = 'shutdown'
else:
logger.info('Received signal: ' + headphones.SIGNAL)
if headphones.SIGNAL == 'shutdown':