aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2021-07-11 04:03:59 +0100
committerMark Powers <mark@marks.kitchen>2021-07-11 04:03:59 +0100
commita981a50b0597498a9fc92249f93f940998455ca3 (patch)
tree6ec956fc4946878809a29e6bd333c48c8bbdf2bd /main.py
Initial commit
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/main.py b/main.py
new file mode 100755
index 0000000..ec3d0b6
--- /dev/null
+++ b/main.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+
+from dial import DialManager, DialThread
+from phone import PhoneManager
+
+from time import sleep
+from queue import Queue
+
+if __name__ == "__main__":
+ queue = Queue()
+ dial_thread = DialThread(queue)
+ print("starting thread")
+ dial_thread.start()
+
+ dial_manager = DialManager()
+ phone_manager = PhoneManager()
+
+ print("main loop")
+ while True:
+ dialed = queue.get(block=True)
+ response = dial_manager.dial(dialed)
+ if response is not None:
+ phone_manager.handle_event(response)
+