Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions source/JABHandler.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# -*- coding: UTF-8 -*-
#javaAccessBridgeHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2007-2017 NV Access Limited, Peter Vágner, Renaud Paquay, Babbage B.V.
#Copyright (C) 2007-2018 NV Access Limited, Peter Vágner, Renaud Paquay, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

try:
import Queue as queue # Python 2.7 import
except ImportError:
import queue # Python 3 import
import queue
from ctypes import *
from ctypes.wintypes import *
import time
Expand Down
5 changes: 1 addition & 4 deletions source/NVDAHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

import os
import sys
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import msvcrt
import versionInfo
import winKernel
Expand Down
2 changes: 1 addition & 1 deletion source/brailleDisplayDrivers/baum.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import time
from collections import OrderedDict
from cStringIO import StringIO
from io import StringIO
import braille
import inputCore
from logHandler import log
Expand Down
2 changes: 1 addition & 1 deletion source/brailleDisplayDrivers/eurobraille.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#Copyright (C) 2017-2019 NV Access Limited, Babbage B.V., Eurobraille

from collections import OrderedDict, defaultdict
from cStringIO import StringIO
from io import StringIO
import serial
import bdDetect
import braille
Expand Down
2 changes: 1 addition & 1 deletion source/brailleDisplayDrivers/handyTech.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

from collections import OrderedDict
from cStringIO import StringIO
from io import StringIO
import serial # pylint: disable=E0401
import weakref
import hwIo
Expand Down
2 changes: 1 addition & 1 deletion source/brailleDisplayDrivers/hims.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#Copyright (C) 2010-2018 Gianluca Casalino, NV Access Limited, Babbage B.V., Leonard de Ruijter, Bram Duvigneau

import serial
from cStringIO import StringIO
from io import StringIO
import os
import hwIo
import braille
Expand Down
5 changes: 1 addition & 4 deletions source/brailleDisplayDrivers/papenmeier.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@

#for brxcom
import ctypes as c
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import winUser

#for scripting
Expand Down
7 changes: 2 additions & 5 deletions source/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
"""

import globalVars
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import ctypes
import ctypes.wintypes
import os
import sys
from cStringIO import StringIO
from io import StringIO
import itertools
import contextlib
from copy import deepcopy
Expand Down
2 changes: 1 addition & 1 deletion source/config/configSpec.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

from cStringIO import StringIO
from io import StringIO
from configobj import ConfigObj

#: The version of the schema outlined in this file. Increment this when modifying the schema and
Expand Down
5 changes: 1 addition & 4 deletions source/easeOfAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"""Utilities for working with the Windows Ease of Access Center.
"""

try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import ctypes
import winUser
from winVersion import winVersion
Expand Down
7 changes: 1 addition & 6 deletions source/gui/nvdaControls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
import oleacc
import winUser
import winsound
try:
# Python 3 import
from collections.abc import Callable
except ImportError:
# Python 2 import
from collections import Callable
from collections.abc import Callable

class AutoWidthColumnListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
"""
Expand Down
5 changes: 1 addition & 4 deletions source/hwPortUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import itertools
import ctypes
from ctypes.wintypes import BOOL, WCHAR, HWND, DWORD, ULONG, WORD, USHORT
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import winKernel
from winKernel import SYSTEMTIME
import config
Expand Down
5 changes: 1 addition & 4 deletions source/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

from ctypes import *
from ctypes.wintypes import *
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import threading
import time
import os
Expand Down
2 changes: 1 addition & 1 deletion source/languageHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This module assists in NVDA going global through language services such as converting Windows locale ID's to friendly names and presenting available languages.
"""

import __builtin__
import builtins
import os
import sys
import ctypes
Expand Down
5 changes: 1 addition & 4 deletions source/mathType.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"""Utilities for working with MathType.
"""

try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import ctypes
import mathPres

Expand Down
5 changes: 1 addition & 4 deletions source/nvda.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ if not mutex or ctypes.windll.kernel32.GetLastError()==ERROR_ALREADY_EXISTS:

isSecureDesktop = desktopName == "Winlogon"
if isSecureDesktop:
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
try:
k = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, ur"SOFTWARE\NVDA")
if not winreg.QueryValueEx(k, u"serviceDebug")[0]:
Expand Down
2 changes: 1 addition & 1 deletion source/pythonConsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
To use, call L{initialize} to create a singleton instance of the console GUI. This can then be accessed externally as L{consoleUI}.
"""

import __builtin__
import builtins
import os
import code
import sys
Expand Down
5 changes: 1 addition & 4 deletions source/queueHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
#See the file COPYING for more details.

import types
try:
from Queue import Queue # Python 2.7 import
except ImportError:
from queue import Queue # Python 3 import
from queue import Queue
import globalVars
from logHandler import log
import watchdog
Expand Down
5 changes: 1 addition & 4 deletions source/synthDrivers/_espeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import time
import nvwave
import threading
try:
import Queue as queue # Python 2.7 import
except ImportError:
import queue # Python 3 import
import queue
from ctypes import *
import config
import globalVars
Expand Down
1 change: 0 additions & 1 deletion source/synthDrivers/espeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import os
from collections import OrderedDict
from . import _espeak
import Queue
import threading
import languageHandler
from synthDriverHandler import SynthDriver, VoiceInfo, synthIndexReached, synthDoneSpeaking
Expand Down
9 changes: 3 additions & 6 deletions source/synthDrivers/oneCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@
import sys
from collections import OrderedDict
import ctypes
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import wave
import cStringIO
from synthDriverHandler import SynthDriver, VoiceInfo, synthIndexReached, synthDoneSpeaking
import io
from logHandler import log
import config
import nvwave
Expand Down Expand Up @@ -329,7 +326,7 @@ def _callback(self, bytes, len, markers):
self._processQueue()
return
# This gets called in a background thread.
stream = cStringIO.StringIO(ctypes.string_at(bytes, len))
stream = io.BytesIO(ctypes.string_at(bytes, len))
wav = wave.open(stream, "r")
self._maybeInitPlayer(wav)
data = wav.readframes(wav.getnframes())
Expand Down
5 changes: 1 addition & 4 deletions source/synthDrivers/sapi4.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

import locale
from collections import OrderedDict
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
from comtypes import COMObject, COMError
from ctypes import *
from synthDriverHandler import SynthDriver,VoiceInfo, synthIndexReached, synthDoneSpeaking
Expand Down
5 changes: 1 addition & 4 deletions source/synthDrivers/sapi5.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
from ctypes import *
import comtypes.client
from comtypes import COMError
try:
import _winreg as winreg # Python 2.7 import
except ImportError:
import winreg # Python 3 import
import winreg
import audioDucking
import NVDAHelper
import globalVars
Expand Down