From e43f11339fa2fc85bb69e1cf774391a43de3764a Mon Sep 17 00:00:00 2001 From: RumovZ Date: Tue, 13 Apr 2021 11:30:32 +0200 Subject: [PATCH] Declare all legacy pathnames in browser init --- qt/aqt/browser/__init__.py | 2 ++ qt/aqt/browser/sidebar/__init__.py | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/qt/aqt/browser/__init__.py b/qt/aqt/browser/__init__.py index 15e42606f..4ce6d4e92 100644 --- a/qt/aqt/browser/__init__.py +++ b/qt/aqt/browser/__init__.py @@ -37,3 +37,5 @@ from .table import ( # aliases for legacy pathnames sys.modules["aqt.find_and_replace"] = sys.modules["aqt.browser.dialogs"] aqt.find_and_replace = sys.modules["aqt.browser.dialogs"] # type: ignore +sys.modules["aqt.sidebar"] = sys.modules["aqt.browser.sidebar"] +aqt.sidebar = sys.modules["aqt.browser.sidebar"] # type: ignore diff --git a/qt/aqt/browser/sidebar/__init__.py b/qt/aqt/browser/sidebar/__init__.py index 5eaef6809..f7c73c32a 100644 --- a/qt/aqt/browser/sidebar/__init__.py +++ b/qt/aqt/browser/sidebar/__init__.py @@ -1,8 +1,5 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -import sys - -import aqt from anki.utils import isMac from aqt.theme import theme_manager @@ -16,7 +13,3 @@ from .model import SidebarModel from .searchbar import SidebarSearchBar from .toolbar import SidebarTool, SidebarToolbar from .tree import SidebarStage, SidebarTreeView - -# alias for the legacy pathname -sys.modules["aqt.sidebar"] = sys.modules["aqt.browser.sidebar"] -aqt.sidebar = sys.modules["aqt.browser.sidebar"] # type: ignore