Skip to content

Fix mistake in displayModel.DisplayModelTextInfo.getTextInChunks#7437

Merged
michaelDCurran merged 1 commit into
nvaccess:masterfrom
BabbageCom:getTextInChunksFix
Jul 25, 2017
Merged

Fix mistake in displayModel.DisplayModelTextInfo.getTextInChunks#7437
michaelDCurran merged 1 commit into
nvaccess:masterfrom
BabbageCom:getTextInChunksFix

Conversation

@LeonarddeR
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR commented Jul 24, 2017

Link to issue number:

None

Summary of the issue:

In the getTextInChunks method on displayModel.DisplayModelTextInfo, a fallback with super is used for reading units other than line. However, the function tries to call _getTextInChunks on the super object, which does not exist.

Description of how this pull request fixes the issue:

Removes the leading underscore from the super(DisplayModelTextInfo,self).getTextInChunks call so that it actually succeeds.

Testing performed:

In Wordpad

import displayModel
next(displayModel.DisplayModelTextInfo(fg,"all").getTextInChunks("readingChunk"))

Known issues with pull request:

None

…ere the wrong function name was used for super
@michaelDCurran
Copy link
Copy Markdown
Member

Out of interest, how did you find this bug? I.e. what is the practical use case that caused you to notice it?

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

@michaelDCurran commented on 24 jul. 2017 23:30 CEST:

Out of interest, how did you find this bug? I.e. what is the practical use case that caused you to notice it?

I was trying to get the display model text word for word, but that failed

next(displayModel.DisplayModelTextInfo(fg,"all").getTextInChunks("word"))
  File "nvda\source\displayModel.py", line 479, in getTextInChunks
    for chunk in super(DisplayModelTextInfo,self)._getTextInChunks(unit):
AttributeError: 'super' object has no attribute '_getTextInChunks'

@michaelDCurran michaelDCurran merged commit 0401b3b into nvaccess:master Jul 25, 2017
@nvaccessAuto nvaccessAuto added this to the 2017.3 milestone Jul 25, 2017
@michaelDCurran
Copy link
Copy Markdown
Member

Merged straight to master as none of our code ever exercises this path, and it is really just a typo fix.

@LeonarddeR LeonarddeR added the BabbageWork Pull requests filed on behalf of Babbage B.V. label Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BabbageWork Pull requests filed on behalf of Babbage B.V.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants