Skip to content

Commit

Permalink
[coding style] flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
tsengwoody committed Oct 10, 2022
1 parent 16f3864 commit f09af9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
29 changes: 5 additions & 24 deletions addon/synthDrivers/WorldVoice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ class SynthDriver(SynthDriver):
defaultVal=0,
minStep=1,
),
# '''DriverSetting(
# "speechcommandsgenerate",
# _("SpeechCommands generate timing"),
# defaultVal="BNP",
#),
DriverSetting(
"normalization",
_("Normalization"),
Expand Down Expand Up @@ -299,7 +294,7 @@ def outputTags():
if isinstance(command, str):
# command = command.strip()
# if not command:
# continue
# continue
# If character mode is on use lower case characters
# Because the synth does not allow to turn off the caps reporting
if charMode or len(command) == 1:
Expand Down Expand Up @@ -340,7 +335,7 @@ def outputTags():
voiceInstance.speak(speech.CHUNK_SEPARATOR.join(chunks).replace(" \x1b", "\x1b"))
chunks = []
hasText = False
elif isinstance(command, voice.Voice):
elif isinstance(command, Voice):
newInstance = command
if hasText: # We changed voice, send what we already have to vocalizer.
voiceInstance.speak(speech.CHUNK_SEPARATOR.join(chunks).replace(" \x1b", "\x1b"))
Expand Down Expand Up @@ -403,7 +398,7 @@ def outputTags():
log.debugWarning("Couldn't convert character in IPA string: %s" % item.ipa)
if item.text:
textList.append(item.text)
elif isinstance(command, voice.Voice):
elif isinstance(command, Voice):
newInstance = command
tags.clear()
tagsChanged[0] = True
Expand Down Expand Up @@ -432,7 +427,7 @@ def outputTags():
voiceInstance.index(item.index)
elif isinstance(item, CharacterModeCommand):
charMode = item.state
elif isinstance(command, voice.Voice):
elif isinstance(command, Voice):
newInstance = command
charMode = False
voiceInstance = newInstance
Expand All @@ -444,7 +439,7 @@ def outputTags():
else:
log.error("Unknown speech: %s" % item)
elif voiceInstance.engine == "OneCore" or voiceInstance.engine == "RH":
if isinstance(command, voice.Voice):
if isinstance(command, Voice):
newInstance = command
voiceInstance.speak(chunks)
chunks = []
Expand Down Expand Up @@ -584,20 +579,6 @@ def _set_normalization(self, value):
if value in self.availableNormalizations:
self._normalization = value

def _get_availableSpeechcommandsgenerates(self):
values = OrderedDict([
("BNP", StringParameterInfo("BNP", _("before NVDA processing"))),
("ANP", StringParameterInfo("ANP", _("after NVDA processing"))),
])
return values

def _get_speechcommandsgenerate(self):
return self._speechcommandsgenerate

def _set_speechcommandsgenerate(self, value):
if value in self.availableSpeechcommandsgenerates:
self._speechcommandsgenerate = value

def _get_availableNumlans(self):
return dict(
{
Expand Down
3 changes: 2 additions & 1 deletion addon/synthDrivers/WorldVoice/voice/_sapi5.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ class SpeechVoiceEvents(IntEnum):
EndInputStream = 4
Bookmark = 16


voiceLock = None


def initialize(lock):
global voiceLock
voiceLock = lock
Expand Down Expand Up @@ -137,4 +139,3 @@ def resume():
if speakingInstance is not None:
instance = speakingInstance
instance.resume()

0 comments on commit f09af9c

Please sign in to comment.