From da9426177d4d138e299db1e9b2566f54fcc1ab38 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 20 Dec 2019 10:21:20 +1000 Subject: [PATCH] typing fixes --- aqt/browser.py | 5 +++-- aqt/main.py | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aqt/browser.py b/aqt/browser.py index 5e2e73676..26901e42d 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -486,10 +486,11 @@ class SidebarModel(QAbstractItemModel): self._expandWhereNeccessary(idx, tree) def _expandWhereNeccessary(self, parent: QModelIndex, tree: QTreeView) -> None: + parentItem: SidebarItem if not parent.isValid(): parentItem = self.root else: - parentItem: SidebarItem = parent.internalPointer() + parentItem = parent.internalPointer() # nothing to do? if not parentItem.expanded: @@ -972,7 +973,7 @@ by clicking on one on the left.""")) self.sidebarTree.setUniformRowHeights(True) self.sidebarTree.setHeaderHidden(True) self.sidebarTree.setIndentation(15) - self.sidebarTree.expanded.connect(self.onSidebarItemExpanded) + self.sidebarTree.expanded.connect(self.onSidebarItemExpanded) # type: ignore dw.setWidget(self.sidebarTree) p = QPalette() p.setColor(QPalette.Base, p.window().color()) diff --git a/aqt/main.py b/aqt/main.py index 89ad6b0d6..f098adc6a 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -13,7 +13,6 @@ from threading import Thread from typing import Optional from send2trash import send2trash from anki.collection import _Collection -from aqt.profiles import ProfileManager from aqt.qt import * from anki.storage import Collection from anki.utils import isWin, isMac, intTime, splitFields, ids2str, \ @@ -34,7 +33,7 @@ from aqt.qt import sip from anki.lang import _, ngettext class AnkiQt(QMainWindow): - def __init__(self, app: QApplication, profileManager: ProfileManager, opts, args): + def __init__(self, app: QApplication, profileManager, opts, args): QMainWindow.__init__(self) self.state = "startup" self.opts = opts