Exemplo n.º 1
0
 def _availClozeOrds(self,
                     m: NotetypeDict,
                     flds: str,
                     allowEmpty: bool = True) -> List[int]:
     print(
         "_availClozeOrds() is deprecated; use note.cloze_numbers_in_fields()"
     )
     note = _pb.Note(fields=[flds])
     return list(self.col._backend.cloze_numbers_in_note(note))
Exemplo n.º 2
0
 def to_backend_note(self) -> _pb.Note:
     hooks.note_will_flush(self)
     return _pb.Note(
         id=self.id,
         guid=self.guid,
         notetype_id=self.mid,
         mtime_secs=self.mod,
         usn=self.usn,
         tags=self.tags,
         fields=self.fields,
     )
Exemplo n.º 3
0
 def new_note(self, ntid: int) -> pb.Note:
     input = pb.NoteTypeID(ntid=ntid)
     output = pb.Note()
     output.ParseFromString(self._run_command(68, input))
     return output
Exemplo n.º 4
0
 def get_note(self, nid: int) -> pb.Note:
     input = pb.NoteID(nid=nid)
     output = pb.Note()
     output.ParseFromString(self._run_command(71, input))
     return output
Exemplo n.º 5
0
 def _availClozeOrds(
     self, notetype: NotetypeDict, flds: str, allow_empty: bool = True
 ) -> List[int]:
     note = _pb.Note(fields=[flds])
     return list(self.col._backend.cloze_numbers_in_note(note))