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.
This commit is contained in:
Damien Elmes 2021-05-31 15:32:12 +10:00
parent 25e4e4c8f6
commit bb323615dd
3 changed files with 2 additions and 17 deletions

View File

@ -39,11 +39,11 @@ from anki.cards import Card, CardId
from anki.config import Config, ConfigManager from anki.config import Config, ConfigManager
from anki.consts import * from anki.consts import *
from anki.dbproxy import DBProxy 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.errors import AbortSchemaModification, DBError
from anki.lang import FormatTimeSpan from anki.lang import FormatTimeSpan
from anki.media import MediaManager, media_paths_from_col_path 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.notes import Note, NoteId
from anki.scheduler.v1 import Scheduler as V1Scheduler from anki.scheduler.v1 import Scheduler as V1Scheduler
from anki.scheduler.v2 import Scheduler as V2Scheduler from anki.scheduler.v2 import Scheduler as V2Scheduler
@ -343,19 +343,6 @@ class Collection:
"Save updates to an existing deck." "Save updates to an existing deck."
return self._backend.update_deck(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 getCard = get_card
getNote = get_note getNote = get_note

View File

@ -35,7 +35,6 @@ DeckConfigDict = Dict[str, Any]
# currently only supports read-only access # currently only supports read-only access
Deck = _pb.Deck Deck = _pb.Deck
DeckConfig = _pb.DeckConfig
DeckId = NewType("DeckId", int) DeckId = NewType("DeckId", int)
DeckConfigId = NewType("DeckConfigId", int) DeckConfigId = NewType("DeckConfigId", int)

View File

@ -28,7 +28,6 @@ from anki.utils import (
) )
# public exports # public exports
Notetype = _pb.Notetype
NotetypeNameId = _pb.NotetypeNameId NotetypeNameId = _pb.NotetypeNameId
NotetypeNameIdUseCount = _pb.NotetypeNameIdUseCount NotetypeNameIdUseCount = _pb.NotetypeNameIdUseCount