From 0841b1f07e436b36ca71decee24ad12f69a82936 Mon Sep 17 00:00:00 2001 From: buddsean Date: Thu, 20 May 2021 18:12:52 +1000 Subject: [PATCH] retain backwards compatibility --- source/controlTypes/__init__.py | 205 ++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) diff --git a/source/controlTypes/__init__.py b/source/controlTypes/__init__.py index 5f12d79dbd3..12a1c4542b4 100644 --- a/source/controlTypes/__init__.py +++ b/source/controlTypes/__init__.py @@ -3,6 +3,9 @@ # See the file COPYING for more details. # Copyright (C) 2007-2021 NV Access Limited, Babbage B.V. +from buildVersion import version_year + +# imports used in __all__ from .isCurrent import IsCurrent from .processing import OutputReason, processAndLabelStates, processNegativeStates, processPositiveStates from .role import ROLE, roleLabels, silentRolesOnFocus, silentValuesForRoles @@ -24,3 +27,205 @@ "negativeStateLabels", "stateLabels", ] + + +# Added to maintain backwards compatibility, marked for deprecation to be removed in 2022.1 +if version_year < 2022: + ROLE_UNKNOWN = ROLE.UNKNOWN + ROLE_WINDOW = ROLE.WINDOW + ROLE_TITLEBAR = ROLE.TITLEBAR + ROLE_PANE = ROLE.PANE + ROLE_DIALOG = ROLE.DIALOG + ROLE_CHECKBOX = ROLE.CHECKBOX + ROLE_RADIOBUTTON = ROLE.RADIOBUTTON + ROLE_STATICTEXT = ROLE.STATICTEXT + ROLE_EDITABLETEXT = ROLE.EDITABLETEXT + ROLE_BUTTON = ROLE.BUTTON + ROLE_MENUBAR = ROLE.MENUBAR + ROLE_MENUITEM = ROLE.MENUITEM + ROLE_POPUPMENU = ROLE.POPUPMENU + ROLE_COMBOBOX = ROLE.COMBOBOX + ROLE_LIST = ROLE.LIST + ROLE_LISTITEM = ROLE.LISTITEM + ROLE_GRAPHIC = ROLE.GRAPHIC + ROLE_HELPBALLOON = ROLE.HELPBALLOON + ROLE_TOOLTIP = ROLE.TOOLTIP + ROLE_LINK = ROLE.LINK + ROLE_TREEVIEW = ROLE.TREEVIEW + ROLE_TREEVIEWITEM = ROLE.TREEVIEWITEM + ROLE_TAB = ROLE.TAB + ROLE_TABCONTROL = ROLE.TABCONTROL + ROLE_SLIDER = ROLE.SLIDER + ROLE_PROGRESSBAR = ROLE.PROGRESSBAR + ROLE_SCROLLBAR = ROLE.SCROLLBAR + ROLE_STATUSBAR = ROLE.STATUSBAR + ROLE_TABLE = ROLE.TABLE + ROLE_TABLECELL = ROLE.TABLECELL + ROLE_TABLECOLUMN = ROLE.TABLECOLUMN + ROLE_TABLEROW = ROLE.TABLEROW + ROLE_TABLECOLUMNHEADER = ROLE.TABLECOLUMNHEADER + ROLE_TABLEROWHEADER = ROLE.TABLEROWHEADER + ROLE_FRAME = ROLE.FRAME + ROLE_TOOLBAR = ROLE.TOOLBAR + ROLE_DROPDOWNBUTTON = ROLE.DROPDOWNBUTTON + ROLE_CLOCK = ROLE.CLOCK + ROLE_SEPARATOR = ROLE.SEPARATOR + ROLE_FORM = ROLE.FORM + ROLE_HEADING = ROLE.HEADING + ROLE_HEADING1 = ROLE.HEADING1 + ROLE_HEADING2 = ROLE.HEADING2 + ROLE_HEADING3 = ROLE.HEADING3 + ROLE_HEADING4 = ROLE.HEADING4 + ROLE_HEADING5 = ROLE.HEADING5 + ROLE_HEADING6 = ROLE.HEADING6 + ROLE_PARAGRAPH = ROLE.PARAGRAPH + ROLE_BLOCKQUOTE = ROLE.BLOCKQUOTE + ROLE_TABLEHEADER = ROLE.TABLEHEADER + ROLE_TABLEBODY = ROLE.TABLEBODY + ROLE_TABLEFOOTER = ROLE.TABLEFOOTER + ROLE_DOCUMENT = ROLE.DOCUMENT + ROLE_ANIMATION = ROLE.ANIMATION + ROLE_APPLICATION = ROLE.APPLICATION + ROLE_BOX = ROLE.BOX + ROLE_GROUPING = ROLE.GROUPING + ROLE_PROPERTYPAGE = ROLE.PROPERTYPAGE + ROLE_CANVAS = ROLE.CANVAS + ROLE_CAPTION = ROLE.CAPTION + ROLE_CHECKMENUITEM = ROLE.CHECKMENUITEM + ROLE_DATEEDITOR = ROLE.DATEEDITOR + ROLE_ICON = ROLE.ICON + ROLE_DIRECTORYPANE = ROLE.DIRECTORYPANE + ROLE_EMBEDDEDOBJECT = ROLE.EMBEDDEDOBJECT + ROLE_ENDNOTE = ROLE.ENDNOTE + ROLE_FOOTER = ROLE.FOOTER + ROLE_FOOTNOTE = ROLE.FOOTNOTE + ROLE_GLASSPANE = ROLE.GLASSPANE + ROLE_HEADER = ROLE.HEADER + ROLE_IMAGEMAP = ROLE.IMAGEMAP + ROLE_INPUTWINDOW = ROLE.INPUTWINDOW + ROLE_LABEL = ROLE.LABEL + ROLE_NOTE = ROLE.NOTE + ROLE_PAGE = ROLE.PAGE + ROLE_RADIOMENUITEM = ROLE.RADIOMENUITEM + ROLE_LAYEREDPANE = ROLE.LAYEREDPANE + ROLE_REDUNDANTOBJECT = ROLE.REDUNDANTOBJECT + ROLE_ROOTPANE = ROLE.ROOTPANE + ROLE_EDITBAR = ROLE.EDITBAR + ROLE_TERMINAL = ROLE.TERMINAL + ROLE_RICHEDIT = ROLE.RICHEDIT + ROLE_RULER = ROLE.RULER + ROLE_SCROLLPANE = ROLE.SCROLLPANE + ROLE_SECTION = ROLE.SECTION + ROLE_SHAPE = ROLE.SHAPE + ROLE_SPLITPANE = ROLE.SPLITPANE + ROLE_VIEWPORT = ROLE.VIEWPORT + ROLE_TEAROFFMENU = ROLE.TEAROFFMENU + ROLE_TEXTFRAME = ROLE.TEXTFRAME + ROLE_TOGGLEBUTTON = ROLE.TOGGLEBUTTON + ROLE_BORDER = ROLE.BORDER + ROLE_CARET = ROLE.CARET + ROLE_CHARACTER = ROLE.CHARACTER + ROLE_CHART = ROLE.CHART + ROLE_CURSOR = ROLE.CURSOR + ROLE_DIAGRAM = ROLE.DIAGRAM + ROLE_DIAL = ROLE.DIAL + ROLE_DROPLIST = ROLE.DROPLIST + ROLE_SPLITBUTTON = ROLE.SPLITBUTTON + ROLE_MENUBUTTON = ROLE.MENUBUTTON + ROLE_DROPDOWNBUTTONGRID = ROLE.DROPDOWNBUTTONGRID + ROLE_MATH = ROLE.MATH + ROLE_GRIP = ROLE.GRIP + ROLE_HOTKEYFIELD = ROLE.HOTKEYFIELD + ROLE_INDICATOR = ROLE.INDICATOR + ROLE_SPINBUTTON = ROLE.SPINBUTTON + ROLE_SOUND = ROLE.SOUND + ROLE_WHITESPACE = ROLE.WHITESPACE + ROLE_TREEVIEWBUTTON = ROLE.TREEVIEWBUTTON + ROLE_IPADDRESS = ROLE.IPADDRESS + ROLE_DESKTOPICON = ROLE.DESKTOPICON + ROLE_INTERNALFRAME = ROLE.INTERNALFRAME + ROLE_DESKTOPPANE = ROLE.DESKTOPPANE + ROLE_OPTIONPANE = ROLE.OPTIONPANE + ROLE_COLORCHOOSER = ROLE.COLORCHOOSER + ROLE_FILECHOOSER = ROLE.FILECHOOSER + ROLE_FILLER = ROLE.FILLER + ROLE_MENU = ROLE.MENU + ROLE_PANEL = ROLE.PANEL + ROLE_PASSWORDEDIT = ROLE.PASSWORDEDIT + ROLE_FONTCHOOSER = ROLE.FONTCHOOSER + ROLE_LINE = ROLE.LINE + ROLE_FONTNAME = ROLE.FONTNAME + ROLE_FONTSIZE = ROLE.FONTSIZE + ROLE_BOLD = ROLE.BOLD + ROLE_ITALIC = ROLE.ITALIC + ROLE_UNDERLINE = ROLE.UNDERLINE + ROLE_FGCOLOR = ROLE.FGCOLOR + ROLE_BGCOLOR = ROLE.BGCOLOR + ROLE_SUPERSCRIPT = ROLE.SUPERSCRIPT + ROLE_SUBSCRIPT = ROLE.SUBSCRIPT + ROLE_STYLE = ROLE.STYLE + ROLE_INDENT = ROLE.INDENT + ROLE_ALIGNMENT = ROLE.ALIGNMENT + ROLE_ALERT = ROLE.ALERT + ROLE_DATAGRID = ROLE.DATAGRID + ROLE_DATAITEM = ROLE.DATAITEM + ROLE_HEADERITEM = ROLE.HEADERITEM + ROLE_THUMB = ROLE.THUMB + ROLE_CALENDAR = ROLE.CALENDAR + ROLE_VIDEO = ROLE.VIDEO + ROLE_AUDIO = ROLE.AUDIO + ROLE_CHARTELEMENT = ROLE.CHARTELEMENT + ROLE_DELETED_CONTENT = ROLE.DELETED_CONTENT + ROLE_INSERTED_CONTENT = ROLE.INSERTED_CONTENT + ROLE_LANDMARK = ROLE.LANDMARK + ROLE_ARTICLE = ROLE.ARTICLE + ROLE_REGION = ROLE.REGION + ROLE_FIGURE = ROLE.FIGURE + ROLE_MARKED_CONTENT = ROLE.MARKED_CONTENT + + +# Added to maintain backwards compatibility, marked for deprecation to be removed in 2022.1 +if version_year < 2022: + STATE_UNAVAILABLE = STATE.UNAVAILABLE + STATE_FOCUSED = STATE.FOCUSED + STATE_SELECTED = STATE.SELECTED + STATE_BUSY = STATE.BUSY + STATE_PRESSED = STATE.PRESSED + STATE_CHECKED = STATE.CHECKED + STATE_HALFCHECKED = STATE.HALFCHECKED + STATE_READONLY = STATE.READONLY + STATE_EXPANDED = STATE.EXPANDED + STATE_COLLAPSED = STATE.COLLAPSED + STATE_INVISIBLE = STATE.INVISIBLE + STATE_VISITED = STATE.VISITED + STATE_LINKED = STATE.LINKED + STATE_HASPOPUP = STATE.HASPOPUP + STATE_PROTECTED = STATE.PROTECTED + STATE_REQUIRED = STATE.REQUIRED + STATE_DEFUNCT = STATE.DEFUNCT + STATE_INVALID_ENTRY = STATE.INVALID_ENTRY + STATE_MODAL = STATE.MODAL + STATE_AUTOCOMPLETE = STATE.AUTOCOMPLETE + STATE_MULTILINE = STATE.MULTILINE + STATE_ICONIFIED = STATE.ICONIFIED + STATE_OFFSCREEN = STATE.OFFSCREEN + STATE_SELECTABLE = STATE.SELECTABLE + STATE_FOCUSABLE = STATE.FOCUSABLE + STATE_CLICKABLE = STATE.CLICKABLE + STATE_EDITABLE = STATE.EDITABLE + STATE_CHECKABLE = STATE.CHECKABLE + STATE_DRAGGABLE = STATE.DRAGGABLE + STATE_DRAGGING = STATE.DRAGGING + STATE_DROPTARGET = STATE.DROPTARGET + STATE_SORTED = STATE.SORTED + STATE_SORTED_ASCENDING = STATE.SORTED_ASCENDING + STATE_SORTED_DESCENDING = STATE.SORTED_DESCENDING + STATE_HASLONGDESC = STATE.HASLONGDESC + STATE_PINNED = STATE.PINNED + STATE_HASFORMULA = STATE.HASFORMULA + STATE_HASCOMMENT = STATE.HASCOMMENT + STATE_OBSCURED = STATE.OBSCURED + STATE_CROPPED = STATE.CROPPED + STATE_OVERFLOWING = STATE.OVERFLOWING + STATE_UNLOCKED = STATE.UNLOCKED + STATE_HAS_ARIA_DETAILS = STATE.HAS_ARIA_DETAILS