aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/main.py b/main.py
index 674e644..db8b983 100755
--- a/main.py
+++ b/main.py
@@ -24,15 +24,18 @@ if __name__ == "__main__":
hang_up_thread.start()
while True:
- # Wait for phone to be picked up
- phone_held.wait()
- # Dial a number
try:
- dialed = queue.get(block=True, timeout=0.1)
- except:
- continue
- response = dial_manager.dial(dialed)
- # If we matched a sequence, play out event
- if response is not None:
- response.speak()
+ # Wait for phone to be picked up
+ phone_held.wait()
+ # Dial a number
+ try:
+ dialed = queue.get(block=True, timeout=0.1)
+ except:
+ continue
+ response = dial_manager.dial(dialed)
+ # If we matched a sequence, play out event
+ if response is not None:
+ response.speak()
+ except Exception as e:
+ print(e)