internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: nvaccess/nvda

Issue:
Support for the Orbit Reader 20 braille display
Update the Baum driver to support the [Orbit Reader 20](http://www.transformingbraille.org/orbit-reader-20-details/).



Discussion:

Resolving patch:
diff --git a/source/brailleDisplayDrivers/baum.py b/source/brailleDisplayDrivers/baum.py
--- a/source/brailleDisplayDrivers/baum.py
+++ b/source/brailleDisplayDrivers/baum.py
@@ -3,7 +3,7 @@
 #A part of NonVisual Desktop Access (NVDA)
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
-#Copyright (C) 2010-2015 NV Access Limited
+#Copyright (C) 2010-2016 NV Access Limited
 
 import time
 from collections import OrderedDict
@@ -87,6 +87,7 @@
 	"VID_0904&PID_4005", # Pronto! 40 V3
 	"VID_0904&PID_4007", # Pronto! 18 V4
 	"VID_0904&PID_4008", # Pronto! 40 V4
+	"VID_0483&PID_A1D3", # Orbit Reader 20
 }
 
 BLUETOOTH_NAMES = (
@@ -99,12 +100,13 @@
 	"BrailleConnect",
 	"Pronto!",
 	"VarioUltra",
+	"Orbit Reader 20",
 )
 
 class BrailleDisplayDriver(braille.BrailleDisplayDriver):
 	name = "baum"
 	# Translators: Names of braille displays.
-	description = _("Baum/HumanWare/APH braille displays")
+	description = _("Baum/HumanWare/APH/Orbit braille displays")
 	isThreadSafe = True
 
 	@classmethod
@@ -143,6 +145,9 @@ def _getAutoPorts(cls, comPorts):
 					continue
 				if usbID not in USB_IDS_SER:
 					continue
+			elif hwID == r"USB\VID_0483&PID_5740&REV_0200":
+				# Generic STMicroelectronics Virtual COM Port used by Orbit Reader 20.
+				portType = "USB serial"
 			elif "bluetoothName" in portInfo:
 				# Bluetooth.
 				portType = "bluetooth"
@@ -174,9 +179,16 @@ def __init__(self, port="Auto"):
 			except EnvironmentError:
 				continue
 			if self.isHid:
-				# Some displays don't support BAUM_PROTOCOL_ONOFF.
+				try:
+					# It's essential to send protocol on for the Orbit Reader 20.
+					self._sendRequest(BAUM_PROTOCOL_ONOFF, True)
+				except EnvironmentError:
+					# Pronto! and VarioUltra don't support BAUM_PROTOCOL_ONOFF.
+					pass
+				# Explicitly request device info.
+				# Even where it's supported, BAUM_PROTOCOL_ONOFF doesn't always return device info.
 				self._sendRequest(BAUM_REQUEST_INFO, 0)
-			else:
+			else: # Serial
 				# If the protocol is already on, sending protocol on won't return anything.
 				# First ensure it's off.
 				self._sendRequest(BAUM_PROTOCOL_ONOFF, False)


Test patch:
Repository: nvaccess/nvda

Issue:
Input gesture to toggle simple review mode
In some situations, it can be desirable to quickly switch simple review mode on and off. However, it seems no input gesture script exists for this. I propose adding one left unbound by default.



Discussion:

Resolving patch:
diff --git a/source/globalCommands.py b/source/globalCommands.py
--- a/source/globalCommands.py
+++ b/source/globalCommands.py
@@ -734,6 +734,20 @@ def script_reviewMode_previous(self,gesture):
 	script_reviewMode_previous.__doc__=_("Switches to the previous review mode (e.g. object, document or screen) and positions the review position at the point of the navigator object") 
 	script_reviewMode_previous.category=SCRCAT_TEXTREVIEW
 
+	def script_toggleSimpleReviewMode(self,gesture):
+		if config.conf["reviewCursor"]["simpleReviewMode"]:
+			# Translators: The message announced when toggling simple review mode.
+			state = _("Simple review mode off")
+			config.conf["reviewCursor"]["simpleReviewMode"]=False
+		else:
+			# Translators: The message announced when toggling simple review mode.
+			state = _("Simple review mode on")
+			config.conf["reviewCursor"]["simpleReviewMode"]=True
+		ui.message(state)
+	# Translators: Input help mode message for toggle simple review mode command.
+	script_toggleSimpleReviewMode.__doc__=_("Toggles simple review mode on and off")
+	script_toggleSimpleReviewMode.category=SCRCAT_OBJECTNAVIGATION
+
 	def script_navigatorObject_current(self,gesture):
 		curObject=api.getNavigatorObject()
 		if not isinstance(curObject,NVDAObject):


Test patch:
Repository: nvaccess/nvda

Issue:
speech.speakObject should output to Speech Viewer when speech mode is off
STR:
1. Enable Speech Viewer.
2. Press NVDA+s until NVDA says "speech mode off".
3. Press NVDA+tab to report the focus.
   - Expected: Info about the focus in the Speech Viewer.
   - Actual: Nothing in the Speech Viewer.

`speech.speakObject` optimises by returning early if speech mode is off. It should check if Speech Viewer is active as well.



Discussion:

Resolving patch:
diff --git a/source/speech.py b/source/speech.py
--- a/source/speech.py
+++ b/source/speech.py
@@ -257,8 +257,6 @@ def _speakSpellingGen(text,locale,useCharacterDescriptions):
 		if args: buf.append(args)
 
 def speakObjectProperties(obj,reason=controlTypes.REASON_QUERY,index=None,**allowedProperties):
-	if speechMode==speechMode_off:
-		return
 	#Fetch the values for all wanted properties
 	newPropertyValues={}
 	positionInfo=None


Test patch:
Repository: nvaccess/nvda

Issue:
When toggling between Full shaped mode and Half shaped mode, braille message is needed
This case happen in east-Asian input methods.

Steps to reproduce:
1. Open text editor.
2. Press ctrl+space switch to native input.
3. Press shift+space
  speech: Full shaped mode
  braille: nothing
  expected: Full shaped mode
1. Press shift+space again
   speech: Half shaped mode
   braille: nothing
   expected: Half shaped mode



Discussion:
This will be addressed by the fix for #5892.


Resolving patch:
diff --git a/source/NVDAHelper.py b/source/NVDAHelper.py
--- a/source/NVDAHelper.py
+++ b/source/NVDAHelper.py
@@ -259,7 +259,7 @@ def nvdaControllerInternal_inputCandidateListUpdate(candidatesString,selectionIn
 } 
 
 def handleInputConversionModeUpdate(oldFlags,newFlags,lcid):
-	import speech
+	import ui
 	textList=[]
 	if newFlags!=oldFlags and lcid&0xff==0x11: #Japanese
 		msg=JapaneseInputConversionModeMessages.get(newFlags)
@@ -275,7 +275,7 @@ def handleInputConversionModeUpdate(oldFlags,newFlags,lcid):
 			if newOn!=oldOn: 
 				textList.append(msgs[0] if newOn else msgs[1])
 	if len(textList)>0:
-		queueHandler.queueFunction(queueHandler.eventQueue,speech.speakMessage," ".join(textList))
+		queueHandler.queueFunction(queueHandler.eventQueue,ui.message," ".join(textList))
 
 @WINFUNCTYPE(c_long,c_long,c_long,c_ulong)
 def nvdaControllerInternal_inputConversionModeUpdate(oldFlags,newFlags,lcid):


Test patch:
Repository: nvaccess/nvda

Issue:
Outlook 2016: NVDA reads "Associated draft, no associated drafts" for every message
Tested on latest Outlook 2016 from Office 365. @dkager reported that he has the same problem since yesterday with Office 365 as well.
# Steps to reproduce:
1. Open a mail folder (e.g. inbox)
2. Arrow through the message list
# Technical details

For every item in the message list, NVDA does the following:
1. Use Outlooks' native COM interface to query some message attributes (read/unread, attachment, meeting request etc)
2. Do a direct UIA query to loop over the children of the table row, filtered by controlType text

The "Associated draft" column has either been added very recently, or changed it's type to text and so is included in the loop in step 2.
# Solution

I'm not that familiar with Outlook, but I guess this column sometimes contains real information about an associated draft, so just dropping it might not be the solution. We might drop it if it contains the "no associated drafts" value, but this is something that should be translated exactly in all languages and is to error prone. May be Microsoft can revert this change or we can come up with a better way to determine which columns to read.



Discussion:
I've reverted to version 16.0.6965.2063. The problem is nonexistent in that version. I had a brief look at the changelogs, but didn't see any clue what changed to make this strange behavior happen.

I've reverted to version 16.0.6965.2063. The problem is nonexistent in that version. I had a brief look at the changelogs, but didn't see any clue what changed to make this strange behavior happen.

For completeness' sake, I had the same issue with Outlook 2016 from Office 365 and the solution posted above worked to resolve it.


Resolving patch:
diff --git a/source/appModules/outlook.py b/source/appModules/outlook.py
--- a/source/appModules/outlook.py
+++ b/source/appModules/outlook.py
@@ -418,6 +418,11 @@ def _get_name(self):
 		cachedChildren=self.UIAElement.buildUpdatedCache(childrenCacheRequest).getCachedChildren()
 		for index in xrange(cachedChildren.length):
 			e=cachedChildren.getElement(index)
+			# #6219: Outlook 2016 started exposing the draft column as a text node.
+			# Users reportedly find this extremely annoying.
+			# Thus we filter it out.
+			if self.appModule.outlookVersion>=16 and e.cachedClassName=="DraftFlagField":
+				continue
 			name=e.cachedName
 			columnHeaderTextList=[]
 			if name and config.conf['documentFormatting']['reportTableHeaders']:


Test patch:
Repository: nvaccess/nvda

Issue:
Language handler: Aragonese (an) reported as "unknown language" or "Afar"
Hi,
Someone contacted me via Skype to report to following:
When you arrow through list of languages in NVDA, Aragonese is listed as either "unknown language" or "Afar".

STR:
1. Using latest master snapshot, open General Settings and arrow through list of languages.
2. Locate Aragonese (or attempt to locate it).

Expected: Aragonese is listed.
Actual: either "unknown language" or "Afar" is shown in place of Aragonese (an).

Thanks.



Discussion:
Hi,

Technical: I don't know why, but Windows returns lang code 4096 for all unknown langs. I'm afraid a case to catch this is in order (unless 4096 is used for specific LCID).

If this is a major showstopper, I'd be happy to create a PR; on the other hand, I'd like to recommend a new developer (perhaps someone outside of NV Access) should do it so they can learn something new.

Thanks.

Hi,

Reference:
- System.Globalization.CultureInfo class (MSDN): https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.lcid(v=vs.110).aspx

No wonder why Windows 10 systems show "unknown language"...

Thanks.


Resolving patch:
diff --git a/source/languageHandler.py b/source/languageHandler.py
--- a/source/languageHandler.py
+++ b/source/languageHandler.py
@@ -1,3 +1,9 @@
+#languageHandler.py
+#A part of NonVisual Desktop Access (NVDA)
+#Copyright (C) 2007-2016 NV access Limited, Joseph Lee
+#This file is covered by the GNU General Public License.
+#See the file COPYING for more details.
+
 import __builtin__
 import os
 import sys
@@ -38,7 +44,9 @@ def getLanguageDescription(language):
 	"""Finds out the description (localized full name) of a given local name"""
 	desc=None
 	LCID=localeNameToWindowsLCID(language)
-	if LCID!=0:
+	# #6259: LCID 0x1000 denotes custom locale in Windows 10, thus returns "unknown language" or an odd description (observed for Aragonese).
+	# See https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.lcid(v=vs.110).aspx.
+	if LCID not in (0, 0x1000):
 		buf=ctypes.create_unicode_buffer(1024)
 		#If the original locale didn't have country info (was just language) then make sure we just get language from Windows
 		if '_' not in language:


Test patch:
Repository: nvaccess/nvda

Issue:
App module handler: handle executable names with dots as part of the file name
**Reported by nvdakor on 2015-08-29 02:29**
Hi,
Consider the following scenario: an app module writer will write support for an app that contains dots as part of the executable image name. However, due to Python's way of searching for paths, the new app module will not be loaded. For example, suppose if one needs to support an app named "foo.bar.exe", Python will fail to locate "foo.bar.py" - assuming "foo" is a package and "bar" as one of its modules.
To handle this case, add a checking routine in app module handler's app module fetch routine to see if an executable name has dots, and if so, replace dots with underscores. This allows app modules for apps with dots as part of the executable name to replace the offending dots with underscores (which will not confuse Python). With this change, app module handler will be able to handle apps such as Microsoft Photos (Microsoft.photos.exe with the app module of Microsoft_photos.py), Universal Windows App (UWA) version of Twitter (twitter.windows.exe) and so on and allows add-on writers to write app modules for these apps (until app developers utilize UIA for the benefit of screen reader users; this last point is crucial now that UWA is here, and these apps are UIA heaven).
Thanks.



Discussion:
Comment 1 by Joseph Lee &lt;joseph.lee22590@... on 2015-08-29 02:36
In [3c876e798da85f4f662e36707a11e985baf62641]:
```CommitTicketReference repository="" revision="3c876e798da85f4f662e36707a11e985baf62641"
App module handler: Executables with dots as file name are now loaded by replacing dots with underscores. re #5323.

Because of Python's way of importing modules, an executable name such as foo.bar would be interpreted as bar module in foo package. To handle this case, underscores will be used. This may also mean how app module is reported to users (Control+NVDA+F1) may have to be modified somehow. For now, each dots will be replaced bd a single underscore.

```
```


Resolving patch:
diff --git a/source/appModuleHandler.py b/source/appModuleHandler.py
--- a/source/appModuleHandler.py
+++ b/source/appModuleHandler.py
@@ -1,7 +1,7 @@
 # -*- coding: UTF-8 -*-
 #appModuleHandler.py
 #A part of NonVisual Desktop Access (NVDA)
-#Copyright (C) 2006-2014 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda
+#Copyright (C) 2006-2016 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda, Joseph Lee
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
 
@@ -108,7 +108,8 @@ def getAppModuleFromProcessID(processID):
 	with _getAppModuleLock:
 		mod=runningTable.get(processID)
 		if not mod:
-			appName=getAppNameFromProcessID(processID)
+			# #5323: Certain executables contain dots as part of their file names.
+			appName=getAppNameFromProcessID(processID).replace(".","_")
 			mod=fetchAppModule(processID,appName)
 			if not mod:
 				raise RuntimeError("error fetching default appModule")


Test patch:
Repository: nvaccess/nvda

Issue:
Tables ignore the numbers in word
In this preview table, alt+ctrl+down in col 1 doesn't read the numbers.
[Match the mountain range with the continent.docx](https://github.com/nvaccess/nvda/files/520648/Match.the.mountain.range.with.the.continent.docx)
[Match the mountain range with the continent.docx](https://github.com/nvaccess/nvda/files/520650/Match.the.mountain.range.with.the.continent.docx)
change txt to docx



Discussion:
This is a fake test question which resembles the bug presented by a real test question in a bio psych class, of which I can't publish because I don't have the test it was part of any more, and it's against the professors policy for me to do so.

I can reproduce this with NVDA Version: next-13613,c68a4d43 on windows 10 and with MS word 2013.

The document contains a table with two columns. Each column contains a numbered list, with one item per row. The first column has items with 1. 2. 3 the second with A. B. C.

None of the numbers/letters are read out when moving through the cells.

There is a work around, by using the read current line command while in each cell. This will successfully read the whole cell but not the whole row. 

Technical: This occurs because list numbering uses the line-prefix attribute, but this is only read for UNIT_LINE and UNIT_PARAGRAPH. Word table movement doesn't currently pass a unit. I think we can pass UNIT_PARAGRAPH. Passing UNIT_PARAGRAPH to speakTextInfo in `NVDAObjects.window.winword._moveInTable` does seem to fix this, but we need to check that there aren't negative implications.

P2 because this causes users to miss information and the fix should be fairly trivial.

Correct, however while arrowing   through a document they work perfectly fine.

Sent from a mobile device.
Please disregard errors as this is a smaller device.

> On Oct 11, 2016, at 21:14, Reef Turner notifications@github.com wrote:
> 
> I can reproduce this with NVDA Version: next-13613,c68a4d43 on windows 10 and with MS word 2013.
> 
> The document contains a table with two columns. Each column contains a numbered list, with one item per row. The first column has items with 1. 2. 3 the second with A. B. C.
> 
> None of the numbers/letters are read out when moving through the cells.
> 
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.


Resolving patch:
diff --git a/source/NVDAObjects/window/winword.py b/source/NVDAObjects/window/winword.py
--- a/source/NVDAObjects/window/winword.py
+++ b/source/NVDAObjects/window/winword.py
@@ -1588,7 +1588,7 @@ def _moveInTable(self,row=True,forward=True):
 			ui.message(_("Edge of table"))
 			return False
 		newInfo=WordDocumentTextInfo(self,textInfos.POSITION_CARET,_rangeObj=foundCell)
-		speech.speakTextInfo(newInfo,reason=controlTypes.REASON_CARET)
+		speech.speakTextInfo(newInfo,reason=controlTypes.REASON_CARET, unit=textInfos.UNIT_PARAGRAPH)
 		newInfo.collapse()
 		newInfo.updateCaret()
 		return True


Test patch:
Repository: nvaccess/nvda

Issue:
IFrame vs Frame
NVDA announces frame in Internet Explorer, but IFrame in Mozilla Firefox. Is this an error on NVDAs part? Can the two be aligned to say the same thing when frames are encountered?



Discussion:
Can you please provide example page/pages?

A good example is on
http://www.freedomscientific.com/Training/Surfs-Up/Frame-Example.htm
Try it in multiple browsers and see the difference.

On 6/7/16, PratikP1 notifications@github.com wrote:

> Can you please provide example page/pages?
> 
> ---
> 
> You are receiving this because you authored the thread.
> Reply to this email directly or view it on GitHub:
> https://github.com/nvaccess/nvda/issues/6047#issuecomment-224332608

Here's what needs to be done here:
1. Change the role for frames in IE to ROLE_INTERNALFRAME.
2. Change the label for ROLE_INTERNALFRAME to "frame", since "IFrame" probably doesn't make a huge amount of sense to users.


Resolving patch:
diff --git a/source/NVDAObjects/IAccessible/MSHTML.py b/source/NVDAObjects/IAccessible/MSHTML.py
--- a/source/NVDAObjects/IAccessible/MSHTML.py
+++ b/source/NVDAObjects/IAccessible/MSHTML.py
@@ -86,7 +86,7 @@ def __getitem__(self,item):
 
 nodeNamesToNVDARoles={
 	"FRAME":controlTypes.ROLE_FRAME,
-	"IFRAME":controlTypes.ROLE_FRAME,
+	"IFRAME":controlTypes.ROLE_INTERNALFRAME,
 	"FRAMESET":controlTypes.ROLE_DOCUMENT,
 	"BODY":controlTypes.ROLE_DOCUMENT,
 	"TH":controlTypes.ROLE_TABLECELL,
diff --git a/source/controlTypes.py b/source/controlTypes.py
--- a/source/controlTypes.py
+++ b/source/controlTypes.py
@@ -426,8 +426,8 @@
 	ROLE_DESKTOPICON:_("desktop icon"),
 	# Translators: Identifies an alert message such as file download alert in Internet explorer 9 and above.
 	ROLE_ALERT:_("alert"),
-	# Translators: Identifies an internal frame (commonly called iframe; usually seen when browsing some sites with Internet Explorer).
-	ROLE_INTERNALFRAME:_("IFrame"),
+	# Translators: Identifies an internal frame. This is usually a frame on a web page; i.e. a web page embedded within a web page.
+	ROLE_INTERNALFRAME:_("frame"),
 	# Translators: Identifies desktop pane (the desktop window).
 	ROLE_DESKTOPPANE:_("desktop pane"),
 	# Translators: Identifies an option pane.


Test patch:
Repository: nvaccess/nvda

Issue:
add keystroke to jump to the end of landmarks
Rationale: Sometimes, mostly in news sites, an aside landamark is found inside a main landmark. That makes the reading experience rather unpleasant. Adding a keyboard command to jump to the end of a landmark would improve the reading experience. Maybe it will make the announcement of the ending would make nVDA too chatty thoguh.



Discussion:
Rather than consuming an extra keystroke, it'd be good if we could have landmarks included in the move past end of container command (comma). This could be a bit tricky, though.

If I want to give this a try, are there any things I should know?


Resolving patch:
diff --git a/source/browseMode.py b/source/browseMode.py
--- a/source/browseMode.py
+++ b/source/browseMode.py
@@ -1486,7 +1486,10 @@ def getEnclosingContainerRange(self,range):
 		try:
 			item = next(self._iterNodesByType("container", "up", range))
 		except (NotImplementedError,StopIteration):
-			return
+			try:
+				item = next(self._iterNodesByType("landmark", "up", range))
+			except (NotImplementedError,StopIteration):
+				return
 		return item.textInfo
 
 	def script_moveToStartOfContainer(self,gesture):
diff --git a/source/virtualBuffers/__init__.py b/source/virtualBuffers/__init__.py
--- a/source/virtualBuffers/__init__.py
+++ b/source/virtualBuffers/__init__.py
@@ -586,7 +586,7 @@ def getEnclosingContainerRange(self,range):
 		containerField=None
 		while controlFields:
 			field=controlFields.pop()
-			if field.getPresentationCategory(controlFields,formatConfig)==field.PRESCAT_CONTAINER:
+			if field.getPresentationCategory(controlFields,formatConfig)==field.PRESCAT_CONTAINER or field.get("landmark"):
 				containerField=field
 				break
 		if not containerField: return None


Test patch:
Repository: nvaccess/nvda

Issue:
Handy Tech driver specific command's can't be assigned in input gestures dialog
In the handy tech driver, there is a script showConfig to show the Handy Tech com server configuration dialog. Currently, this script can't be assigned to other input gestures, which makes the configuration dialog inaccessible for people using a display without b4 and b8 keys, such as the basic braille. They can of course access the window with the right command in the python console, but that isn't that user friendly.

N.B. posted on behalf of @Babbagecom



Discussion:

Resolving patch:
diff --git a/source/brailleDisplayDrivers/handyTech.py b/source/brailleDisplayDrivers/handyTech.py
--- a/source/brailleDisplayDrivers/handyTech.py
+++ b/source/brailleDisplayDrivers/handyTech.py
@@ -14,6 +14,7 @@
 import inputCore
 import os
 from baseObject import ScriptableObject
+from globalCommands import SCRCAT_BRAILLE
 
 COM_CLASS = "HtBrailleDriverServer.HtBrailleDriver"
 HT_KEYS = {}
@@ -81,6 +82,8 @@ def _get_numCells(self):
 	def display(self, cells):
 		self._server.displayText(cells)
 
+	scriptCategory = SCRCAT_BRAILLE
+
 	def script_showConfig(self, gesture):
 		self._server.startConfigDialog(False)
 	script_showConfig.__doc__ = _("Show the Handy Tech driver configuration window.")
diff --git a/source/inputCore.py b/source/inputCore.py
--- a/source/inputCore.py
+++ b/source/inputCore.py
@@ -553,6 +553,8 @@ def __init__(self, obj, ancestors):
 		gmap = braille.handler.display.gestureMap
 		if gmap:
 			self.addGlobalMap(gmap)
+		if isinstance(braille.handler.display, baseObject.ScriptableObject):
+			self.addObj(braille.handler.display)
 
 		# Global plugins.
 		import globalPluginHandler


Test patch: