Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A KeyError is thrown in NVDA 2023.1 #10

Closed
trypsynth opened this issue Nov 28, 2022 · 6 comments
Closed

A KeyError is thrown in NVDA 2023.1 #10

trypsynth opened this issue Nov 28, 2022 · 6 comments

Comments

@trypsynth
Copy link
Contributor

Currently, on NVDA snapshots (later 2023.1), the following is written to the log every time I try to use an indent nav command:
ERROR - scriptHandler.executeScript (08:54:47.188) - MainThread (38888):
error executing script: <bound method EditableIndentNav.script_moveToParent of <NVDAObjects.Dynamic_EditWindowScintillaIAccessibleScintillaWindowNVDAObjectEditableIndentNav object at 0x0912AED0>> with gesture 'alt+NVDA+left arrow'
Traceback (most recent call last):
File "scriptHandler.pyc", line 289, in executeScript
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 548, in script_moveToParent
self.move(-1, [msgEditable], unbounded=True, op=operator.lt)
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 485, in move
self.moveInEditable(increment, errorMessages[0], unbounded, op, speakOnly=speakOnly, moveCount=moveCount)
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 527, in moveInEditable
self.crackle(indentLevels)
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 418, in crackle
if self.isReportIndentWithTones():
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 415, in isReportIndentWithTones
return config.conf["documentFormatting"]["reportLineIndentationWithTones"]
File "config_init_.pyc", line 1058, in getitem
KeyError: 'reportLineIndentationWithTones'
This is most likely due to the following entry in the changelog:
• The configuration specification has been altered, keys have been removed or modified (#14233).
◦ In [documentFormatting] section:
▪ reportLineIndentation stores an int value (0 to 3) instead of a boolean
▪ reportLineIndentationWithTones has been removed.
I'm not sure what value tones has in that range of integers, but perhaps its documented somewhere? In any case I imagine this is probably a pretty simple fix. Going to give it a look when I have time, but if you have any other ideas or are able to fix it faster, that would be great too! :)

@trypsynth
Copy link
Contributor Author

This actually turned out to be a one-line fix. Going to PR, but before I do, I have a quick question on how this works. Currently, I'm checking if the value is greater than or equal to 2, because 3 is both speech and tones. Is this correct behavior? Was the old boolean also set if both speech and tones was selected?

@mltony
Copy link
Owner

mltony commented Nov 28, 2022 via email

@trypsynth
Copy link
Contributor Author

Hi,
Yeah, I certainly can. I'm not sure where, if anywhere, that would be, but I'll do some digging.
My question about the speech and tones question is basically this: If you set your line indentation reporting to both speech and tones, is that boolean still true? I don't have an old version of NVDA anymore, so I can't really check.
Thanks.

@trypsynth
Copy link
Contributor Author

Aha, found it. Its config.configFlags.ReportLineIndentation. Will make my code use it later today. Am still curious about that speech and tones question, though.

@mltony
Copy link
Owner

mltony commented Nov 28, 2022 via email

@trypsynth
Copy link
Contributor Author

Alright, thanks. Will probably have the PR up by tomorrow

@mltony mltony closed this as completed in ddf5421 Dec 10, 2022
mltony added a commit that referenced this issue Dec 10, 2022
Use new configuration values for telling if indentation reporting is turned on. Closes #10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants