Skip to content

Commit

Permalink
fix: add proper imports (#3296)
Browse files Browse the repository at this point in the history
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
  • Loading branch information
davidculley and dae authored Aug 5, 2024
1 parent 44380dd commit bab83ff
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions pylib/anki/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import pprint
import time
from typing import NewType

import anki # pylint: disable=unused-import
import anki.collection
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
from aqt import gui_hooks
from aqt.log import setup_logging
from aqt.qt import *
from aqt.qt import sip
from aqt.utils import TR, tr

if TYPE_CHECKING:
Expand Down
2 changes: 2 additions & 0 deletions qt/aqt/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import logging
import os
import re
import sys
import traceback
import zipfile
from collections import defaultdict
from collections.abc import Callable, Iterable, Sequence
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/browser/find_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from anki.collection import SearchNode
from anki.notes import NoteId
from aqt.qt import *
from aqt.qt import sip
from aqt.webview import AnkiWebViewKind

from ..operations import QueryOp
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/browser/sidebar/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
set_tag_collapsed,
)
from aqt.qt import *
from aqt.qt import sip
from aqt.theme import ColoredIcon, theme_manager
from aqt.utils import (
KeyboardModifiersPressed,
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/debug_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

import os
import sys
from collections.abc import Callable
from dataclasses import dataclass
from functools import partial
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/deckchooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from anki.decks import DEFAULT_DECK_ID, DeckId
from aqt import AnkiQt, gui_hooks
from aqt.qt import *
from aqt.qt import sip
from aqt.utils import HelpPage, shortcut, tr


Expand Down
4 changes: 4 additions & 0 deletions qt/aqt/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@

from __future__ import annotations

import os
import re
import sys
import time
import traceback
from typing import TYPE_CHECKING, TextIO, cast

from markdown import markdown

import aqt
from anki.collection import HelpPage
from anki.errors import BackendError, Interrupted
from anki.utils import is_win
from aqt.addons import AddonManager, AddonMeta
from aqt.qt import *
from aqt.utils import openHelp, showWarning, supportText, tooltip, tr
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/import_export/importing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from __future__ import annotations

import os
import re
from abc import ABC, abstractmethod
from collections.abc import Callable
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/importing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import re
import sys
import traceback
import zipfile
from collections.abc import Callable
Expand Down
2 changes: 2 additions & 0 deletions qt/aqt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import os
import re
import signal
import sys
import traceback
import weakref
from argparse import Namespace
from collections.abc import Callable, Sequence
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import aqt.forms
import aqt.operations
from anki.collection import OpChanges
from anki.utils import is_mac
from aqt import AnkiQt
from aqt.operations.collection import set_preferences
from aqt.profiles import VideoDriver
Expand Down
2 changes: 2 additions & 0 deletions qt/aqt/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

import io
import os
import pickle
import random
import shutil
Expand All @@ -23,6 +24,7 @@
from anki.utils import int_time, int_version, is_mac, is_win
from aqt import appHelpSite, gui_hooks
from aqt.qt import *
from aqt.qt import sip
from aqt.theme import Theme, WidgetStyle, theme_manager
from aqt.toolbar import HideMode
from aqt.utils import disable_help_button, send_to_trash, showWarning, tr
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from anki._legacy import print_deprecation_warning
from anki.collection import Progress
from aqt.qt import *
from aqt.qt import sip
from aqt.utils import disable_help_button, tr

# Progress info
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/reviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
)
from anki.tags import MARKED_TAG
from anki.types import assert_exhaustive
from anki.utils import is_mac
from aqt import AnkiQt, gui_hooks
from aqt.browser.card_info import PreviousReviewerCardInfo, ReviewerCardInfo
from aqt.deckoptions import confirm_deck_then_display_options
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import subprocess
import sys
import time
import traceback
import wave
from abc import ABC, abstractmethod
from collections.abc import Callable
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import aqt.forms
import aqt.main
from anki.decks import DeckId
from anki.utils import is_mac
from aqt import gui_hooks
from aqt.operations.deck import set_current_deck
from aqt.qt import *
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/tagedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from anki.collection import Collection
from aqt import gui_hooks
from aqt.qt import *
from aqt.qt import sip


class TagEdit(QLineEdit):
Expand Down
1 change: 1 addition & 0 deletions qt/aqt/taskman.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from __future__ import annotations

import traceback
from collections.abc import Callable
from concurrent.futures import Future
from concurrent.futures.thread import ThreadPoolExecutor
Expand Down
2 changes: 2 additions & 0 deletions qt/aqt/webview.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import dataclasses
import json
import os
import re
import sys
from collections.abc import Callable, Sequence
Expand All @@ -18,6 +19,7 @@
from anki.utils import hmr_mode, is_lin, is_mac, is_win
from aqt import colors, gui_hooks
from aqt.qt import *
from aqt.qt import sip
from aqt.theme import theme_manager
from aqt.utils import askUser, is_gesture_or_zoom_event, openLink, showInfo, tr

Expand Down

0 comments on commit bab83ff

Please sign in to comment.