Skip to content

Commit

Permalink
Correct capitalization error in extensionPoint, and track initial log…
Browse files Browse the repository at this point in the history
…AtStartup value.
  • Loading branch information
Luke Davis authored and Luke Davis committed Aug 30, 2023
1 parent bb00a94 commit ad0f8b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions addon/globalPlugins/speechLogger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def __init__(self):
# Should we log during Say All/Read To End?
logSayAll=True,
# Should we start logging when launched?
logAtStartup=False
logAtStartup=False,
# Becomes True if we were initially set to log at startup
loggedAtStartup=False
)
#: Filenames are obtained from NVDA configuration, and setup in applyUserConfig().
self.files: ImmutableKeyObj = ImmutableKeyObj(local=None, remote=None)
Expand All @@ -133,7 +135,8 @@ def __init__(self):
self.rotateLogs()
# If we are supposed to start logging at NVDA startup, register a handler for that
if self.flags.logAtStartup:
postNVDAStartup.register(self.startLocalLog)
postNvdaStartup.register(self.startLocalLog)
self.flags.loggedAtStartup = True
# Wrap speech.speech.speak, so we can get its output first
self._speak_orig = speech.speech.speak
@wraps(speech.speech.speak)
Expand Down Expand Up @@ -176,7 +179,8 @@ def terminate(self) -> None:
speech.speech.speak = self._speak_orig
SpeechWithoutPauses.speakWithoutPauses = SpeechWithoutPauses._speakWithoutPauses_orig
# Unregister extensionPoints
postNVDAStartup.unregister(self.startLocalLog)
if self.flags.loggedAtStartup:
postNvdaStartup.unregister(self.startLocalLog)
extensionPoint._configChanged.unregister(self.applyUserConfig)
super().terminate()

Expand Down
2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _(arg):
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
"addon_description": _("""Logs speech utterances to a file. Can also log NVDA remote session speech from the NVDA Remote add-on, to the same or another file."""),
# version
"addon_version": "23.3.001",
"addon_version": "23.3.002",
# Author(s)
"addon_author": "Luke Davis <XLTechie@newanswertech.com>, James Scholes",
# URL for the add-on documentation support
Expand Down

0 comments on commit ad0f8b6

Please sign in to comment.