From a32ef31382702119103888221c6bcbedf28936a3 Mon Sep 17 00:00:00 2001 From: Abdo Date: Sun, 29 Jun 2025 22:03:58 +0300 Subject: [PATCH] Fix lint errors --- qt/aqt/editor.py | 4 +--- qt/aqt/utils.py | 8 +++++--- ts/routes/editor/NoteEditor.svelte | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 5ee4fce37..5610d64ed 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -382,8 +382,7 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too def onBridgeCmd(self, cmd: str) -> Any: # focus lost or key/button pressed? if cmd.startswith("blur") or cmd.startswith("key"): - (type, ord_str) = cmd.split(":", 1) - ord = int(ord_str) + (type, _) = cmd.split(":", 1) if type == "blur": self.currentField = None else: @@ -458,7 +457,6 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too @on_editor_ready def load_note(self, mid: int, focus_to: int | None = None) -> None: - self.widget.show() def oncallback(arg: Any) -> None: diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 2002c4615..2c49b2e65 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -15,8 +15,10 @@ from functools import partial, wraps from pathlib import Path from typing import TYPE_CHECKING, Any, Literal, Union -import aqt import requests +from send2trash import send2trash + +import aqt from anki._legacy import DeprecatedNamesMixinForModule from anki.collection import Collection, HelpPage from anki.httpclient import HttpClient @@ -30,9 +32,9 @@ from anki.utils import ( version_with_build, ) from aqt.qt import * -from aqt.qt import QT_VERSION_STR # noqa: F401 from aqt.qt import ( PYQT_VERSION_STR, + QT_VERSION_STR, # noqa: F401 QAction, QApplication, QCheckBox, @@ -82,7 +84,6 @@ from aqt.qt import ( traceback, ) from aqt.theme import theme_manager -from send2trash import send2trash if TYPE_CHECKING: TextFormat = Literal["plain", "rich", "markdown"] @@ -1014,6 +1015,7 @@ def show_in_folder(path: str) -> None: def _show_in_folder_win32(path: str) -> None: import win32con import win32gui + from aqt import mw def focus_explorer(): diff --git a/ts/routes/editor/NoteEditor.svelte b/ts/routes/editor/NoteEditor.svelte index b0bd2bc3a..3bef364b9 100644 --- a/ts/routes/editor/NoteEditor.svelte +++ b/ts/routes/editor/NoteEditor.svelte @@ -91,7 +91,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const [onContextMenu, contextMenuItems] = setupContextMenu(); let contextMenuInput: EditingInputAPI | null = null; - function quoteFontFamily(fontFamily: string): string { // generic families (e.g. sans-serif) must not be quoted if (!/^[-a-z]+$/.test(fontFamily)) {