import keypad_polling import UISpeaker import my_deque import threading __author__ = 'Dan' # temp = deque() sema = threading.Semaphore(0) q = my_deque.my_deque() speaker = UISpeaker.UI_Speaker() key_pad = keypad_polling.keypad(q, sema, speaker) while True: print key_pad.get_input_ext_num("ENTER EXTENDED NUMBER") print "exit"
global speaker while True: voiceSema.acquire() if not voiceQueue.empty(): item = voiceQueue.popleft() if item is not None: speaker.speak(item) print item else: time.sleep(1) thread = voiceThread(1, "VQ") thread.start() voiceQueue = my_deque.my_deque() voiceSema = threading.Semaphore(0) speaker = pyespeak.Speaker() while True: voiceQueue.append(1, time.time()) voiceSema.release() voiceQueue.append_high('a', time.time()) voiceSema.release() voiceQueue.append(2, time.time()) voiceSema.release() voiceQueue.append(3, time.time()) voiceSema.release() voiceQueue.append_high('b', time.time()) voiceSema.release() voiceQueue.append(4, time.time()-10)