mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Fix lint errors
This commit is contained in:
parent
939d833e12
commit
a32ef31382
3 changed files with 6 additions and 7 deletions
|
@ -382,8 +382,7 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
||||||
def onBridgeCmd(self, cmd: str) -> Any:
|
def onBridgeCmd(self, cmd: str) -> Any:
|
||||||
# focus lost or key/button pressed?
|
# focus lost or key/button pressed?
|
||||||
if cmd.startswith("blur") or cmd.startswith("key"):
|
if cmd.startswith("blur") or cmd.startswith("key"):
|
||||||
(type, ord_str) = cmd.split(":", 1)
|
(type, _) = cmd.split(":", 1)
|
||||||
ord = int(ord_str)
|
|
||||||
if type == "blur":
|
if type == "blur":
|
||||||
self.currentField = None
|
self.currentField = None
|
||||||
else:
|
else:
|
||||||
|
@ -458,7 +457,6 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
||||||
|
|
||||||
@on_editor_ready
|
@on_editor_ready
|
||||||
def load_note(self, mid: int, focus_to: int | None = None) -> None:
|
def load_note(self, mid: int, focus_to: int | None = None) -> None:
|
||||||
|
|
||||||
self.widget.show()
|
self.widget.show()
|
||||||
|
|
||||||
def oncallback(arg: Any) -> None:
|
def oncallback(arg: Any) -> None:
|
||||||
|
|
|
@ -15,8 +15,10 @@ from functools import partial, wraps
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any, Literal, Union
|
from typing import TYPE_CHECKING, Any, Literal, Union
|
||||||
|
|
||||||
import aqt
|
|
||||||
import requests
|
import requests
|
||||||
|
from send2trash import send2trash
|
||||||
|
|
||||||
|
import aqt
|
||||||
from anki._legacy import DeprecatedNamesMixinForModule
|
from anki._legacy import DeprecatedNamesMixinForModule
|
||||||
from anki.collection import Collection, HelpPage
|
from anki.collection import Collection, HelpPage
|
||||||
from anki.httpclient import HttpClient
|
from anki.httpclient import HttpClient
|
||||||
|
@ -30,9 +32,9 @@ from anki.utils import (
|
||||||
version_with_build,
|
version_with_build,
|
||||||
)
|
)
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from aqt.qt import QT_VERSION_STR # noqa: F401
|
|
||||||
from aqt.qt import (
|
from aqt.qt import (
|
||||||
PYQT_VERSION_STR,
|
PYQT_VERSION_STR,
|
||||||
|
QT_VERSION_STR, # noqa: F401
|
||||||
QAction,
|
QAction,
|
||||||
QApplication,
|
QApplication,
|
||||||
QCheckBox,
|
QCheckBox,
|
||||||
|
@ -82,7 +84,6 @@ from aqt.qt import (
|
||||||
traceback,
|
traceback,
|
||||||
)
|
)
|
||||||
from aqt.theme import theme_manager
|
from aqt.theme import theme_manager
|
||||||
from send2trash import send2trash
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
TextFormat = Literal["plain", "rich", "markdown"]
|
TextFormat = Literal["plain", "rich", "markdown"]
|
||||||
|
@ -1014,6 +1015,7 @@ def show_in_folder(path: str) -> None:
|
||||||
def _show_in_folder_win32(path: str) -> None:
|
def _show_in_folder_win32(path: str) -> None:
|
||||||
import win32con
|
import win32con
|
||||||
import win32gui
|
import win32gui
|
||||||
|
|
||||||
from aqt import mw
|
from aqt import mw
|
||||||
|
|
||||||
def focus_explorer():
|
def focus_explorer():
|
||||||
|
|
|
@ -91,7 +91,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
const [onContextMenu, contextMenuItems] = setupContextMenu();
|
const [onContextMenu, contextMenuItems] = setupContextMenu();
|
||||||
let contextMenuInput: EditingInputAPI | null = null;
|
let contextMenuInput: EditingInputAPI | null = null;
|
||||||
|
|
||||||
|
|
||||||
function quoteFontFamily(fontFamily: string): string {
|
function quoteFontFamily(fontFamily: string): string {
|
||||||
// generic families (e.g. sans-serif) must not be quoted
|
// generic families (e.g. sans-serif) must not be quoted
|
||||||
if (!/^[-a-z]+$/.test(fontFamily)) {
|
if (!/^[-a-z]+$/.test(fontFamily)) {
|
||||||
|
|
Loading…
Reference in a new issue