mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Monkeytype anki/rsbackend.py
This commit is contained in:
parent
02dd30f2a0
commit
b451f4e3f2
1 changed files with 5 additions and 3 deletions
|
@ -178,7 +178,9 @@ def proto_progress_to_native(progress: pb.Progress) -> Progress:
|
|||
|
||||
|
||||
class RustBackend:
|
||||
def __init__(self, col_path: str, media_folder_path: str, media_db_path: str):
|
||||
def __init__(
|
||||
self, col_path: str, media_folder_path: str, media_db_path: str
|
||||
) -> None:
|
||||
ftl_folder = os.path.join(anki.lang.locale_folder, "fluent")
|
||||
init_msg = pb.BackendInit(
|
||||
collection_path=col_path,
|
||||
|
@ -340,7 +342,7 @@ class RustBackend:
|
|||
)
|
||||
).format_time_span
|
||||
|
||||
def studied_today(self, cards: int, seconds: float,) -> str:
|
||||
def studied_today(self, cards: int, seconds: float) -> str:
|
||||
return self._run_command(
|
||||
pb.BackendInput(
|
||||
studied_today=pb.StudiedTodayIn(cards=cards, seconds=seconds)
|
||||
|
@ -376,7 +378,7 @@ class I18nBackend:
|
|||
)
|
||||
self._backend = ankirspy.open_i18n(init_msg.SerializeToString())
|
||||
|
||||
def translate(self, key: TR, **kwargs: Union[str, int, float]):
|
||||
def translate(self, key: TR, **kwargs: Union[str, int, float]) -> str:
|
||||
return self._backend.translate(
|
||||
translate_string_in(key, **kwargs).SerializeToString()
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue