mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-26 18:09:21 +00:00
24 lines
606 B
Python
24 lines
606 B
Python
from base import Output, OutputError
|
|
|
|
class VoiceOver (Output):
|
|
"""Supports the VoiceOver screenreader on the Mac.
|
|
|
|
Note that this will also output as a message to the braille display if VoiceOver is used with braille.
|
|
Calling this module could cause VoiceOver to be started.
|
|
"""
|
|
name = 'VoiceOver'
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
super(VoiceOver, self).__init__(*args, **kwargs)
|
|
try:
|
|
from appscript import app
|
|
self.app = app('VoiceOver')
|
|
except ImportError:
|
|
raise OutputError
|
|
|
|
def speak(self, text, interupt=False):
|
|
self.app.output(text)
|
|
|
|
def is_active(self):
|
|
return True
|