Declare all legacy pathnames in browser init

This commit is contained in:
RumovZ 2021-04-13 11:30:32 +02:00
parent 88086596b6
commit e43f11339f
2 changed files with 2 additions and 7 deletions

View File

@ -37,3 +37,5 @@ from .table import (
# aliases for legacy pathnames # aliases for legacy pathnames
sys.modules["aqt.find_and_replace"] = sys.modules["aqt.browser.dialogs"] sys.modules["aqt.find_and_replace"] = sys.modules["aqt.browser.dialogs"]
aqt.find_and_replace = sys.modules["aqt.browser.dialogs"] # type: ignore 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

View File

@ -1,8 +1,5 @@
# Copyright: Ankitects Pty Ltd and contributors # Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import sys
import aqt
from anki.utils import isMac from anki.utils import isMac
from aqt.theme import theme_manager from aqt.theme import theme_manager
@ -16,7 +13,3 @@ from .model import SidebarModel
from .searchbar import SidebarSearchBar from .searchbar import SidebarSearchBar
from .toolbar import SidebarTool, SidebarToolbar from .toolbar import SidebarTool, SidebarToolbar
from .tree import SidebarStage, SidebarTreeView 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