mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-27 18:29:23 +00:00
Made code indentation to comply with PEP8
This commit is contained in:
@@ -8,28 +8,28 @@ import sys
|
||||
speaker = None
|
||||
|
||||
def speak(text, interrupt=0, speech=True, braille=True):
|
||||
global speaker
|
||||
if not speaker:
|
||||
setup()
|
||||
if speech:
|
||||
speaker.speak(text, interrupt)
|
||||
if braille:
|
||||
speaker.braille(text)
|
||||
global speaker
|
||||
if not speaker:
|
||||
setup()
|
||||
if speech:
|
||||
speaker.speak(text, interrupt)
|
||||
if braille:
|
||||
speaker.braille(text)
|
||||
|
||||
def setup ():
|
||||
global speaker
|
||||
logging.debug("Initializing output subsystem.")
|
||||
try:
|
||||
# speaker = speech.Speaker(speech.outputs.Sapi5())
|
||||
# else:
|
||||
speaker = outputs.auto.Auto()
|
||||
except:
|
||||
return logging.exception("Output: Error during initialization.")
|
||||
global speaker
|
||||
logging.debug("Initializing output subsystem.")
|
||||
try:
|
||||
# speaker = speech.Speaker(speech.outputs.Sapi5())
|
||||
# else:
|
||||
speaker = outputs.auto.Auto()
|
||||
except:
|
||||
return logging.exception("Output: Error during initialization.")
|
||||
|
||||
def copy(text):
|
||||
import win32clipboard
|
||||
#Copies text to the clipboard.
|
||||
win32clipboard.OpenClipboard()
|
||||
win32clipboard.EmptyClipboard()
|
||||
win32clipboard.SetClipboardText(text, win32clipboard.CF_UNICODETEXT)
|
||||
win32clipboard.CloseClipboard()
|
||||
import win32clipboard
|
||||
#Copies text to the clipboard.
|
||||
win32clipboard.OpenClipboard()
|
||||
win32clipboard.EmptyClipboard()
|
||||
win32clipboard.SetClipboardText(text, win32clipboard.CF_UNICODETEXT)
|
||||
win32clipboard.CloseClipboard()
|
||||
|
Reference in New Issue
Block a user