Skip to content

Make several speech functions return sequences instead of strings #10098

@LeonarddeR

Description

@LeonarddeR

Brought up by @jcsteh

Is your feature request related to a problem? Please describe.

Something that's going to be needed to get the full benefit of speech refactor is to make speech.getControlFieldSpeech and speech.getFormatFieldSpeech return speech sequences instead of simple strings. For example, this will be necessary if we want to use sounds instead of text to indicate spelling errors, change voice parameters for emphasised text or links, etc.

Originally, @jcsteh intended this to be done later. However, given that it's a pretty big backwards compatibility break, He pointed out whether it'd make sense to do that before the first Python 3 based release is shipped.

Describe the solution you'd like

The following functions need to return speech sequences (lists) instead of strings:
Note: used git grep -E "def get(\w+)Speech"

  • speech.getSpeechTextForProperties: rename while at it?
  • speech.getControlFieldSpeech
  • speech.getFormatFieldSpeech
  • appModules.kindle.BookPageViewTextInfo.getFormatFieldSpeech
  • browseMode.BrowseModeDocumentTextInfo.getControlFieldSpeech
  • treeInterceptorHandler.RootProxyTextInfo.getFormatFieldSpeech: It actually amazes me that there is no treeInterceptorHandler.RootProxyTextInfo.getControlFieldSpeech override

@derekriemer brought up speech.getIndentationSpeech, whereas I'd say speech.getTableInfoSpeech is also a candidate.

Describe alternatives you've considered

Leave code as is now. It shouldn't be very difficult to add backwards compatibility later on by means of instance checking for controlFieldSpeech and formatFieldSPeech provided by custom TextInfo implementations.

Cc @feerrenrut

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions