diff options
author | Mark Powers <mark@marks.kitchen> | 2021-07-11 04:03:59 +0100 |
---|---|---|
committer | Mark Powers <mark@marks.kitchen> | 2021-07-11 04:03:59 +0100 |
commit | a981a50b0597498a9fc92249f93f940998455ca3 (patch) | |
tree | 6ec956fc4946878809a29e6bd333c48c8bbdf2bd /main.py |
Initial commit
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -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) + |