diff --git a/source/NVDAObjects/__init__.py b/source/NVDAObjects/__init__.py index 4518d60b30a..05b2877b2be 100644 --- a/source/NVDAObjects/__init__.py +++ b/source/NVDAObjects/__init__.py @@ -7,7 +7,6 @@ """Module that contains the base NVDA object type""" -from six import with_metaclass import time import re import weakref @@ -147,7 +146,7 @@ def clearDynamicClassCache(cls): """ cls._dynamicClassCache.clear() -class NVDAObject(with_metaclass(DynamicNVDAObjectType, documentBase.TextContainerObject,baseObject.ScriptableObject)): +class NVDAObject(documentBase.TextContainerObject, baseObject.ScriptableObject, metaclass=DynamicNVDAObjectType): """NVDA's representation of a single control/widget. Every widget, regardless of how it is exposed by an application or the operating system, is represented by a single NVDAObject instance. This allows NVDA to work with all widgets in a uniform way. diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py index 87ea5eadb5d..acc5f303c4f 100755 --- a/source/NVDAObjects/window/excel.py +++ b/source/NVDAObjects/window/excel.py @@ -5,7 +5,6 @@ #See the file COPYING for more details. import abc -from six import with_metaclass import ctypes from comtypes import COMError, BSTR import comtypes.automation @@ -1085,7 +1084,7 @@ class FormulaExcelCellInfoQuickNavItem(ExcelCellInfoQuickNavItem): def label(self): return "%s: %s"%(self.excelCellInfo.address.split('!')[-1],self.excelCellInfo.formula) -class ExcelCellInfoQuicknavIterator(with_metaclass(abc.ABCMeta,object)): +class ExcelCellInfoQuicknavIterator(object, metaclass=abc.ABCMeta): cellInfoFlags=NVCELLINFOFLAG_ADDRESS|NVCELLINFOFLAG_COORDS @abc.abstractproperty diff --git a/source/baseObject.py b/source/baseObject.py index f04895a4e5e..30635416391 100755 --- a/source/baseObject.py +++ b/source/baseObject.py @@ -10,7 +10,6 @@ import weakref from logHandler import log from abc import ABCMeta, abstractproperty -from six import with_metaclass class Getter(object): @@ -104,7 +103,7 @@ def __init__(self,name,bases,dict): # The __abstractmethods__ set is frozen, therefore we ought to override it. self.__abstractmethods__=(self.__abstractmethods__|newAbstractProps)-oldAbstractProps -class AutoPropertyObject(with_metaclass(AutoPropertyType, object)): +class AutoPropertyObject(object, metaclass=AutoPropertyType): """A class that dynamically supports properties, by looking up _get_*, _set_*, and _del_* methods at runtime. _get_x will make property x with a getter (you can get its value). _set_x will make a property x with a setter (you can set its value). @@ -188,7 +187,7 @@ def __new__(meta, name, bases, dict): setattr(cls, gesturesDictName, gestures) return cls -class ScriptableObject(with_metaclass(ScriptableType, AutoPropertyObject)): +class ScriptableObject(AutoPropertyObject, metaclass=ScriptableType): """A class that implements NVDA's scripting interface. Input gestures are bound to scripts such that the script will be executed when the appropriate input gesture is received. Scripts are methods named with a prefix of C{script_}; e.g. C{script_foo}. diff --git a/source/browseMode.py b/source/browseMode.py index 255ce94d576..62d46770171 100644 --- a/source/browseMode.py +++ b/source/browseMode.py @@ -35,7 +35,6 @@ import gui.guiHelper from NVDAObjects import NVDAObject from abc import ABCMeta, abstractmethod -from six import with_metaclass REASON_QUICKNAV = "quickNav" @@ -93,7 +92,7 @@ def mergeQuickNavItemIterators(iterators,direction="next"): continue curValues.append((it,newVal)) -class QuickNavItem(with_metaclass(ABCMeta, object)): +class QuickNavItem(object, metaclass=ABCMeta): """ Emitted by L{BrowseModeTreeInterceptor._iterNodesByType}, this represents one of many positions in a browse mode document, based on the type of item being searched for (e.g. link, heading, table etc).""" itemType=None #: The type of items searched for (e.g. link, heading, table etc) diff --git a/source/contentRecog/__init__.py b/source/contentRecog/__init__.py index 2c26da70325..29c9258d389 100644 --- a/source/contentRecog/__init__.py +++ b/source/contentRecog/__init__.py @@ -16,10 +16,9 @@ from collections import namedtuple import textInfos.offsets from abc import ABCMeta, abstractmethod -from six import with_metaclass from locationHelper import RectLTWH -class ContentRecognizer(with_metaclass(ABCMeta, object)): +class ContentRecognizer(object, metaclass=ABCMeta): """Implementation of a content recognizer. """ @@ -129,7 +128,7 @@ def convertHeightToScreen(self, height): """ return int(height / self.resizeFactor) -class RecognitionResult(with_metaclass(ABCMeta, object)): +class RecognitionResult(object, metaclass=ABCMeta): """Provides access to the result of recognition by a recognizer. The result is textual, but to facilitate navigation by word, line, etc. and to allow for retrieval of screen coordinates within the text, diff --git a/source/gui/accPropServer.py b/source/gui/accPropServer.py index 6886b6fbcb8..7560c7b07f6 100644 --- a/source/gui/accPropServer.py +++ b/source/gui/accPropServer.py @@ -11,12 +11,11 @@ from comtypes import COMObject, GUID from comInterfaces.Accessibility import IAccPropServer, ANNO_CONTAINER, ANNO_THIS from abc import ABCMeta, abstractmethod, abstractproperty -from six import with_metaclass import weakref import winUser import wx -class IAccPropServer_Impl(with_metaclass(ABCMeta, COMObject)): +class IAccPropServer_Impl(COMObject, metaclass=ABCMeta): """Base class for implementing a COM interface for a hwnd based AccPropServer\ to annotate a WX control. The AccPropServer registers itself using the window handle of the WX control. diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py index 1e13fbf7342..48917baa23b 100644 --- a/source/gui/settingsDialogs.py +++ b/source/gui/settingsDialogs.py @@ -7,7 +7,6 @@ import logging from abc import abstractmethod -from six import with_metaclass import os import copy import re @@ -50,7 +49,7 @@ import keyLabels from .dpiScalingHelper import DpiScalingHelperMixin -class SettingsDialog(with_metaclass(guiHelper.SIPABCMeta, wx.Dialog, DpiScalingHelperMixin)): +class SettingsDialog(wx.Dialog, DpiScalingHelperMixin, metaclass=guiHelper.SIPABCMeta): """A settings dialog. A settings dialog consists of one or more settings controls and OK and Cancel buttons and an optional Apply button. Action may be taken in response to the OK, Cancel or Apply buttons. @@ -243,7 +242,7 @@ def _onWindowDestroy(self, evt): # redo the layout in whatever way makes sense for their particular content. _RWLayoutNeededEvent, EVT_RW_LAYOUT_NEEDED = wx.lib.newevent.NewCommandEvent() -class SettingsPanel(with_metaclass(guiHelper.SIPABCMeta, wx.Panel, DpiScalingHelperMixin)): +class SettingsPanel(wx.Panel, DpiScalingHelperMixin, metaclass=guiHelper.SIPABCMeta): """A settings panel, to be used in a multi category settings dialog. A settings panel consists of one or more settings controls. Action may be taken in response to the parent dialog's OK or Cancel buttons. diff --git a/source/speech/commands.py b/source/speech/commands.py index 2aa1e10687a..47e83ad7115 100644 --- a/source/speech/commands.py +++ b/source/speech/commands.py @@ -7,7 +7,6 @@ """Commands that can be embedded in a speech sequence for changing synth parameters, playing sounds or running other callbacks.""" from abc import ABCMeta, abstractmethod -from six import with_metaclass import config import languageHandler from synthDriverHandler import getSynth @@ -229,7 +228,7 @@ def __repr__(self): out += ", text=%r" % self.text return out + ")" -class BaseCallbackCommand(with_metaclass(ABCMeta, SpeechCommand)): +class BaseCallbackCommand(SpeechCommand, metaclass=ABCMeta): """Base class for commands which cause a function to be called when speech reaches them. This class should not be instantiated directly. It is designed to be subclassed to provide specific functionality;