mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00

The legacy importer has only been kept around to support some add-ons, and these are so infrequently used that they're better off shifted to add-ons (even they even still work)
27 lines
974 B
Python
27 lines
974 B
Python
# Copyright: Ankitects Pty Ltd and contributors
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
from collections.abc import Callable, Sequence
|
|
from typing import Any, Type, Union
|
|
|
|
import anki
|
|
from anki.collection import Collection
|
|
from anki.importing.anki2 import Anki2Importer
|
|
from anki.importing.apkg import AnkiPackageImporter
|
|
from anki.importing.base import Importer
|
|
from anki.importing.csvfile import TextImporter
|
|
from anki.importing.mnemo import MnemosyneImporter
|
|
from anki.lang import TR
|
|
|
|
|
|
def importers(col: Collection) -> Sequence[tuple[str, type[Importer]]]:
|
|
importers = [
|
|
(col.tr.importing_text_separated_by_tabs_or_semicolons(), TextImporter),
|
|
(
|
|
col.tr.importing_packaged_anki_deckcollection_apkg_colpkg_zip(),
|
|
AnkiPackageImporter,
|
|
),
|
|
(col.tr.importing_mnemosyne_20_deck_db(), MnemosyneImporter),
|
|
]
|
|
anki.hooks.importing_importers(importers)
|
|
return importers
|