Skip to content

Commit 637bf8c

Browse files
authored
Merge aa5d589 into 12f27ac
2 parents 12f27ac + aa5d589 commit 637bf8c

180 files changed

Lines changed: 1079 additions & 1157 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sconstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ def makePot(target, source, env):
394394
"--keyword=pgettext:1c,2",
395395
# Needed because xgettext doesn't recognise the .pyw extension.
396396
"--language=python",
397+
"--from-code=UTF-8",
397398
] + [os.path.relpath(str(f), str(sourceDir)) for f in source]
398399
]) != 0:
399400
raise RuntimeError("xgettext failed")

source/COMRegistrationFixes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: UTF-8 -*-
21
#A part of NonVisual Desktop Access (NVDA)
32
#Copyright (C) 2018 NV Access Limited
43
#This file is covered by the GNU General Public License.

source/JABHandler.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: UTF-8 -*-
21
# A part of NonVisual Desktop Access (NVDA)
32
# Copyright (C) 2007-2019 NV Access Limited, Peter Vágner, Renaud Paquay, Babbage B.V.
43
# This file is covered by the GNU General Public License.
@@ -61,10 +60,10 @@ def _fixBridgeFunc(restype,name,*argtypes,**kwargs):
6160
try:
6261
bridgeDll=getattr(cdll,'windowsAccessBridge-32')
6362
legacyAccessBridge=False
64-
except WindowsError:
63+
except OSError:
6564
try:
6665
bridgeDll=cdll.windowsAccessBridge
67-
except WindowsError:
66+
except OSError:
6867
bridgeDll=None
6968

7069
#Definitions of access bridge types, structs and prototypes
@@ -344,7 +343,7 @@ def getWindowHandleFromAccContext(vmID,accContext):
344343
else:
345344
return vmIDsToWindowHandles.get(vmID)
346345

347-
class JABContext(object):
346+
class JABContext:
348347

349348
def __init__(self,hwnd=None,vmID=None,accContext=None):
350349
if hwnd and not vmID:
@@ -416,7 +415,7 @@ def getAccessibleTextSelectionInfo(self):
416415
def getAccessibleTextRange(self,start,end):
417416
length=((end+1)-start)
418417
if length<=0:
419-
return u""
418+
return ""
420419
# Use a string buffer, as from an unicode buffer, we can't get the raw data.
421420
buf = create_string_buffer((length +1) * 2)
422421
bridgeDll.getAccessibleTextRange(self.vmID, self.accContext, start, end, buf, length)

source/NVDAHelper.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ def _lookupKeyboardLayoutNameWithHexString(layoutString):
8181
buf=create_unicode_buffer(1024)
8282
bufSize=c_int(2048)
8383
key=HKEY()
84-
if windll.advapi32.RegOpenKeyExW(winreg.HKEY_LOCAL_MACHINE,u"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"+ layoutString,0,winreg.KEY_QUERY_VALUE,byref(key))==0:
84+
if windll.advapi32.RegOpenKeyExW(winreg.HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"+ layoutString,0,winreg.KEY_QUERY_VALUE,byref(key))==0:
8585
try:
86-
if windll.advapi32.RegQueryValueExW(key,u"Layout Display Name",0,None,buf,byref(bufSize))==0:
86+
if windll.advapi32.RegQueryValueExW(key,"Layout Display Name",0,None,buf,byref(bufSize))==0:
8787
windll.shlwapi.SHLoadIndirectString(buf.value,buf,1023,None)
8888
return buf.value
89-
if windll.advapi32.RegQueryValueExW(key,u"Layout Text",0,None,buf,byref(bufSize))==0:
89+
if windll.advapi32.RegQueryValueExW(key,"Layout Text",0,None,buf,byref(bufSize))==0:
9090
return buf.value
9191
finally:
9292
windll.advapi32.RegCloseKey(key)
@@ -147,7 +147,7 @@ def handleInputCompositionEnd(result):
147147
from NVDAObjects.inputComposition import InputComposition
148148
from NVDAObjects.IAccessible.mscandui import ModernCandidateUICandidateItem
149149
focus=api.getFocusObject()
150-
result=result.lstrip(u'\u3000 ')
150+
result=result.lstrip('\u3000 ')
151151
curInputComposition=None
152152
if isinstance(focus,InputComposition):
153153
curInputComposition=focus
@@ -176,7 +176,7 @@ def handleInputCompositionEnd(result):
176176
speech.speechMode=oldSpeechMode
177177

178178
if curInputComposition and not result:
179-
result=curInputComposition.compositionString.lstrip(u'\u3000 ')
179+
result=curInputComposition.compositionString.lstrip('\u3000 ')
180180
if result:
181181
speech.speakText(result,symbolLevel=characterProcessing.SYMLVL_ALL)
182182

@@ -386,7 +386,7 @@ def nvdaControllerInternal_inputLangChangeNotify(threadID,hkl,layoutString):
386386
inputMethodName="".join(inputMethodName.split(' - ')[1:])
387387
#Include the language only if it changed.
388388
if languageID!=lastLanguageID:
389-
msg=u"{language} - {layout}".format(language=inputLanguageName,layout=inputMethodName)
389+
msg=f"{inputLanguageName} - {inputMethodName}"
390390
else:
391391
msg=inputMethodName
392392
lastLanguageID=languageID
@@ -418,7 +418,7 @@ def nvdaControllerInternal_installAddonPackageFromPath(addonPath):
418418
wx.CallAfter(addonGui.handleRemoteAddonInstall, addonPath)
419419
return 0
420420

421-
class RemoteLoader64(object):
421+
class RemoteLoader64:
422422

423423
def __init__(self):
424424
# Create a pipe so we can write to stdin of the loader process.
@@ -438,7 +438,7 @@ def __init__(self):
438438
# Therefore, explicitly specify our own process token, which causes them to be inherited.
439439
token = winKernel.OpenProcessToken(winKernel.GetCurrentProcess(), winKernel.MAXIMUM_ALLOWED)
440440
try:
441-
winKernel.CreateProcessAsUser(token, None, os.path.join(versionedLib64Path,u"nvdaHelperRemoteLoader.exe"), None, None, True, None, None, None, si, pi)
441+
winKernel.CreateProcessAsUser(token, None, os.path.join(versionedLib64Path,"nvdaHelperRemoteLoader.exe"), None, None, True, None, None, None, si, pi)
442442
# We don't need the thread handle.
443443
winKernel.closeHandle(pi.hThread)
444444
self._process = pi.hProcess
@@ -505,7 +505,7 @@ def initialize():
505505
log.info("Remote injection disabled due to running as a Windows Store Application")
506506
return
507507
#Load nvdaHelperRemote.dll but with an altered search path so it can pick up other dlls in lib
508-
h=windll.kernel32.LoadLibraryExW(os.path.abspath(os.path.join(versionedLibPath,u"nvdaHelperRemote.dll")),0,0x8)
508+
h=windll.kernel32.LoadLibraryExW(os.path.abspath(os.path.join(versionedLibPath,"nvdaHelperRemote.dll")),0,0x8)
509509
if not h:
510510
log.critical("Error loading nvdaHelperRemote.dll: %s" % WinError())
511511
return

0 commit comments

Comments
 (0)