add a few type hints
This commit is contained in:
parent
3e1b474dca
commit
518cc44267
@ -8,6 +8,7 @@ import operator
|
||||
import unicodedata
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
||||
|
||||
import anki # pylint: disable=unused-import
|
||||
from anki.consts import *
|
||||
from anki.errors import DeckRenameError
|
||||
from anki.hooks import runHook
|
||||
@ -98,7 +99,7 @@ class DeckManager:
|
||||
# Registry save/load
|
||||
#############################################################
|
||||
|
||||
def __init__(self, col) -> None:
|
||||
def __init__(self, col: "anki.storage._Collection") -> None:
|
||||
self.col = col
|
||||
self.decks = {}
|
||||
self.dconf = {}
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from typing import Any, List, Optional, Tuple
|
||||
|
||||
import anki # pylint: disable=unused-import
|
||||
from anki.utils import (
|
||||
fieldChecksum,
|
||||
guid64,
|
||||
@ -19,7 +20,10 @@ class Note:
|
||||
tags: List[str]
|
||||
|
||||
def __init__(
|
||||
self, col, model: Optional[Any] = None, id: Optional[int] = None
|
||||
self,
|
||||
col: "anki.storage._Collection",
|
||||
model: Optional[Any] = None,
|
||||
id: Optional[int] = None,
|
||||
) -> None:
|
||||
assert not (model and id)
|
||||
self.col = col
|
||||
|
@ -14,6 +14,7 @@ import json
|
||||
import re
|
||||
from typing import Callable, Dict, List, Tuple
|
||||
|
||||
import anki # pylint: disable=unused-import
|
||||
from anki.hooks import runHook
|
||||
from anki.utils import ids2str, intTime
|
||||
|
||||
@ -23,7 +24,7 @@ class TagManager:
|
||||
# Registry save/load
|
||||
#############################################################
|
||||
|
||||
def __init__(self, col) -> None:
|
||||
def __init__(self, col: "anki.storage._Collection") -> None:
|
||||
self.col = col
|
||||
self.tags: Dict[str, int] = {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user