aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2021-07-12 04:19:46 +0100
committerMark Powers <mark@marks.kitchen>2021-07-12 04:19:46 +0100
commite3f4893b74b97e1de5e126761d9ec6a0f6585888 (patch)
tree8639ffb0dfe056545d5370802932a8133cfe6083 /main.py
parentc985f5cb690189cfa94078b5990da4776dbd0cf4 (diff)
Add recording event placeholder
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)