mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
fix typo and PEP8 naming in noteimp.py
This commit is contained in:
parent
8e0f00fbb9
commit
7d5014fd5f
1 changed files with 7 additions and 7 deletions
|
@ -21,10 +21,10 @@ from anki.utils import (
|
||||||
timestampID,
|
timestampID,
|
||||||
)
|
)
|
||||||
|
|
||||||
type_tagsMapped = Tuple[int, int, str, str, NoteID, str, str]
|
TagMappedUpdate = Tuple[int, int, str, str, NoteID, str, str]
|
||||||
type_tagsModified = Tuple[int, int, str, str, NoteID, str]
|
TagModifiedUpdate = Tuple[int, int, str, str, NoteID, str]
|
||||||
type_tagsElse = Tuple[int, int, str, NoteID, str]
|
NoTagUpdate = Tuple[int, int, str, NoteID, str]
|
||||||
type_udpates = Union[type_tagsMapped, type_tagsModified, type_tagsElse]
|
Updates = Union[TagMappedUpdate, TagModifiedUpdate, NoTagUpdate]
|
||||||
|
|
||||||
# Stores a list of fields, tags and deck
|
# Stores a list of fields, tags and deck
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@ -142,7 +142,7 @@ class NoteImporter(Importer):
|
||||||
self._fmap = self.col.models.fieldMap(self.model)
|
self._fmap = self.col.models.fieldMap(self.model)
|
||||||
self._nextID = NoteID(timestampID(self.col.db, "notes"))
|
self._nextID = NoteID(timestampID(self.col.db, "notes"))
|
||||||
# loop through the notes
|
# loop through the notes
|
||||||
updates: List[type_udpates] = []
|
updates: List[Updates] = []
|
||||||
updateLog = []
|
updateLog = []
|
||||||
new = []
|
new = []
|
||||||
self._ids: List[NoteID] = []
|
self._ids: List[NoteID] = []
|
||||||
|
@ -278,7 +278,7 @@ class NoteImporter(Importer):
|
||||||
|
|
||||||
def updateData(
|
def updateData(
|
||||||
self, n: ForeignNote, id: NoteID, sflds: List[str]
|
self, n: ForeignNote, id: NoteID, sflds: List[str]
|
||||||
) -> Optional[type_udpates]:
|
) -> Optional[Updates]:
|
||||||
self._ids.append(id)
|
self._ids.append(id)
|
||||||
self.processFields(n, sflds)
|
self.processFields(n, sflds)
|
||||||
if self._tagsMapped:
|
if self._tagsMapped:
|
||||||
|
@ -292,7 +292,7 @@ class NoteImporter(Importer):
|
||||||
else:
|
else:
|
||||||
return (intTime(), self.col.usn(), n.fieldsStr, id, n.fieldsStr)
|
return (intTime(), self.col.usn(), n.fieldsStr, id, n.fieldsStr)
|
||||||
|
|
||||||
def addUpdates(self, rows: List[type_udpates]) -> None:
|
def addUpdates(self, rows: List[Updates]) -> None:
|
||||||
changes = self.col.db.scalar("select total_changes()")
|
changes = self.col.db.scalar("select total_changes()")
|
||||||
if self._tagsMapped:
|
if self._tagsMapped:
|
||||||
self.col.db.executemany(
|
self.col.db.executemany(
|
||||||
|
|
Loading…
Reference in a new issue