From bb323615dd984aabb3aaab12687efdfd4f951ac9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 31 May 2021 15:32:12 +1000 Subject: [PATCH] remove deck config and notetype protobuf from frontend Not yet used by anything yet, and we may want to use native classes for these instead, like is done for Notes and Cards. Decks to follow. --- pylib/anki/collection.py | 17 ++--------------- pylib/anki/decks.py | 1 - pylib/anki/models.py | 1 - 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index dc84b6699..836fb097f 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -39,11 +39,11 @@ from anki.cards import Card, CardId from anki.config import Config, ConfigManager from anki.consts import * from anki.dbproxy import DBProxy -from anki.decks import Deck, DeckConfig, DeckConfigId, DeckId, DeckManager +from anki.decks import Deck, DeckId, DeckManager from anki.errors import AbortSchemaModification, DBError from anki.lang import FormatTimeSpan from anki.media import MediaManager, media_paths_from_col_path -from anki.models import ModelManager, Notetype, NotetypeDict, NotetypeId +from anki.models import ModelManager, NotetypeDict, NotetypeId from anki.notes import Note, NoteId from anki.scheduler.v1 import Scheduler as V1Scheduler from anki.scheduler.v2 import Scheduler as V2Scheduler @@ -343,19 +343,6 @@ class Collection: "Save updates to an existing deck." return self._backend.update_deck(deck) - def get_deck_config(self, id: DeckConfigId) -> DeckConfig: - "Get a new-style deck config object. Currently read-only." - return self._backend.get_deck_config(id) - - def get_notetype(self, id: NotetypeId) -> Notetype: - """Get a new-style notetype object. This is not cached; avoid calling frequently.""" - return self._backend.get_notetype(id) - - def update_notetype(self, notetype: Notetype) -> OpChanges: - "This may force a full sync; caller is responsible for notifying user." - self.models._remove_from_cache(NotetypeId(notetype.id)) - return self._backend.update_notetype(notetype) - getCard = get_card getNote = get_note diff --git a/pylib/anki/decks.py b/pylib/anki/decks.py index d5788d15b..72301012d 100644 --- a/pylib/anki/decks.py +++ b/pylib/anki/decks.py @@ -35,7 +35,6 @@ DeckConfigDict = Dict[str, Any] # currently only supports read-only access Deck = _pb.Deck -DeckConfig = _pb.DeckConfig DeckId = NewType("DeckId", int) DeckConfigId = NewType("DeckConfigId", int) diff --git a/pylib/anki/models.py b/pylib/anki/models.py index e4d43e949..3b064399f 100644 --- a/pylib/anki/models.py +++ b/pylib/anki/models.py @@ -28,7 +28,6 @@ from anki.utils import ( ) # public exports -Notetype = _pb.Notetype NotetypeNameId = _pb.NotetypeNameId NotetypeNameIdUseCount = _pb.NotetypeNameIdUseCount