def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref() self._stats = None self.type = PERIOD_MONTH self.width = 600 self.height = 200 self.wholeCollection = False
def __init__(self, col: anki.storage._Collection, server=None) -> None: self.col = col.weakref() self.server = server # these are set later; provide dummy values for type checking self.lnewer = False self.maxUsn = 0 self.tablesLeft: List[str] = []
def __init__(self, col: anki.storage._Collection, id: Optional[int] = None) -> None: self.col = col.weakref() self.timerStarted = None self._render_output: Optional[anki.template.TemplateRenderOutput] = None if id: # existing card self.id = id self.load() else: # new card with defaults self._load_from_backend_card(BackendCard())
def __init__( # pylint: disable=super-init-not-called self, col: anki.storage._Collection) -> None: self.col = col.weakref() self.queueLimit = 50 self.reportLimit = 1000 self.dynReportLimit = 99999 self.reps = 0 self.lrnCount = 0 self.revCount = 0 self.newCount = 0 self.today: Optional[int] = None self._haveQueues = False self._updateCutoff()
def __init__(self, col: anki.storage._Collection, server: bool) -> None: self.col = col.weakref() if server: self._dir = None return # media directory self._dir = media_paths_from_col_path(self.col.path)[0] if not os.path.exists(self._dir): os.makedirs(self._dir) try: self._oldcwd = os.getcwd() except OSError: # cwd doesn't exist self._oldcwd = None try: os.chdir(self._dir) except OSError: raise Exception("invalidTempFolder")
def __init__( self, col: anki.storage._Collection, model: Optional[NoteType] = None, id: Optional[int] = None, ) -> None: assert not (model and id) self.col = col.weakref() # self.newlyAdded = False if id: # existing note self.id = id self.load() else: # new note for provided notetype self._load_from_backend_note(self.col.backend.new_note( model["id"]))
def __init__( self, col: anki.storage._Collection, model: Optional[NoteType] = None, id: Optional[int] = None, ) -> None: assert not (model and id) self.col = col.weakref() self.newlyAdded = False if id: self.id = id self.load() else: self.id = timestampID(col.db, "notes") self.guid = guid64() self._model = model self.mid = model["id"] self.tags = [] self.fields = [""] * len(self._model["flds"]) self.flags = 0 self.data = "" self._fmap = self.col.models.fieldMap(self._model) self.scm = self.col.scm
def __init__( self, col: anki.storage._Collection, card: Card, note: Note, browser: bool = False, notetype: NoteType = None, template: Optional[Dict] = None, fill_empty: bool = False, ) -> None: self._col = col.weakref() self._card = card self._note = note self._browser = browser self._template = template self._fill_empty = fill_empty if not notetype: self._note_type = note.model() else: self._note_type = notetype # if you need to store extra state to share amongst rendering # hooks, you can insert it into this dictionary self.extra_state: Dict[str, Any] = {}
def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref() self.models = ModelsDictProxy(col) # do not access this directly! self._cache = {}
def __init__(self, col: anki.storage._Collection): self._col = col.weakref()
def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref()
def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref() self.decks = {} self.dconf = {}
def __init__(self, col: anki.storage._Collection, card: anki.cards.Card) -> None: if col: self.col = col.weakref() self.card = card self.txt = ""
def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref() self.decks = {} self._dconf_cache: Optional[Dict[int, Dict[str, Any]]] = None
def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref() self.decks = DecksDictProxy(col)
def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref() self.models = {} self.changed = False
def __init__(self, col: anki.storage._Collection) -> None: self.col = col.weakref() self.tags: Dict[str, int] = {}