From 04849b045aca55b1216aa0e0aa9c520df11af6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Golonka?= Date: Wed, 17 Mar 2021 01:55:23 +0100 Subject: [PATCH] don't rely on star imports from synthDriverHandler (#12172) * synthDriverHandler: Remove unused imports, standardize copyright header * sayAllHandler: Remove unused import of synthDriverHandler * settingsDialog: don't rely on star imports from synthDriverHandler * globalCommands: don't rely onn star imports from synthDriverHandler, remove unused imports * update changes.t2t Co-authored-by: buddsean --- source/globalCommands.py | 5 +---- source/gui/settingsDialogs.py | 6 +++--- source/sayAllHandler.py | 1 - source/synthDriverHandler.py | 5 ----- user_docs/en/changes.t2t | 1 + 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/source/globalCommands.py b/source/globalCommands.py index 5b7ccf10454..c85490c8a55 100644 --- a/source/globalCommands.py +++ b/source/globalCommands.py @@ -6,11 +6,9 @@ # Leonard de Ruijter, Derek Riemer, Babbage B.V., Davy Kager, Ethan Holliger, Łukasz Golonka, Accessolutions, # Julien Cochuyt -import time import itertools from typing import Optional -import tones import audioDucking import touchHandler import keyboardHandler @@ -25,7 +23,6 @@ from NVDAObjects import NVDAObject, NVDAObjectTextInfo import globalVars from logHandler import log -from synthDriverHandler import * import gui import wx import config @@ -34,13 +31,13 @@ import winKernel import treeInterceptorHandler import browseMode +import languageHandler import scriptHandler from scriptHandler import script import ui import braille import brailleInput import inputCore -import virtualBuffers import characterProcessing from baseObject import ScriptableObject import core diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py index 869eed402d0..4b0a9dc40fa 100644 --- a/source/gui/settingsDialogs.py +++ b/source/gui/settingsDialogs.py @@ -6,8 +6,9 @@ # This file is covered by the GNU General Public License. # See the file COPYING for more details. import logging -from abc import ABCMeta +from abc import ABCMeta, abstractmethod import copy +import os import wx from vision.providerBase import VisionEnhancementProviderSettings @@ -17,8 +18,7 @@ import winUser import logHandler import installer -from synthDriverHandler import * -from synthDriverHandler import SynthDriver, getSynth +from synthDriverHandler import changeVoice, getSynth, getSynthList, setSynth, SynthDriver import config import languageHandler import speech diff --git a/source/sayAllHandler.py b/source/sayAllHandler.py index 1490c168916..bb3b7f42ba1 100644 --- a/source/sayAllHandler.py +++ b/source/sayAllHandler.py @@ -6,7 +6,6 @@ import weakref import garbageHandler import speech -import synthDriverHandler from logHandler import log import config import controlTypes diff --git a/source/synthDriverHandler.py b/source/synthDriverHandler.py index 81a76dc1ae5..4fa8aaf732d 100644 --- a/source/synthDriverHandler.py +++ b/source/synthDriverHandler.py @@ -1,19 +1,15 @@ -# -*- coding: UTF-8 -*- -# synthDriverHandler.py # 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) 2006-2019 NV Access Limited, Peter Vágner, Aleksey Sadovoy, # Joseph Lee, Arnold Loubriat, Leonard de Ruijter -import os import pkgutil import importlib from typing import Optional from locale import strxfrm import config -import baseObject import winVersion import globalVars from logHandler import log @@ -23,7 +19,6 @@ import extensionPoints import synthDrivers import driverHandler -from driverHandler import StringParameterInfo # noqa: F401 # Backwards compatibility from abc import abstractmethod diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index a36b9ca1b40..cd53924ca7c 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -70,6 +70,7 @@ What's New in NVDA - `speech.getSpeechForSpelling` has been removed - use `speech.getSpellingSpeech` (#12145) - Commands cannot be directly imported from speech as `import speech; speech.ExampleCommand()` or `import speech.manager; speech.manager.ExampleCommand()` - use `from speech.commands import ExampleCommand` instead (#12126) - `speakTextInfo` will no longer send speech through `speakWithoutPauses` if reason is `SAYALL`, as `sayAllhandler` does this manually now. (#12150) +- The `synthDriverHandler` module is no longer star imported into `globalCommands` and `gui.settingsDialogs` - use `from synthDriverHandler import synthFunctionExample` instead. (#12172) - `ROLE_EQUATION` has been removed from controlTypes - use `ROLE_MATH`` instead. (#12164)