From a981a50b0597498a9fc92249f93f940998455ca3 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sun, 11 Jul 2021 04:03:59 +0100 Subject: Initial commit --- main.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 main.py (limited to 'main.py') 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) + -- cgit v1.2.3