From 7d5014fd5fb79e749b7518bbf9f24d0e46a6264e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 26 Mar 2021 11:28:18 +1000 Subject: [PATCH] fix typo and PEP8 naming in noteimp.py --- pylib/anki/importing/noteimp.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pylib/anki/importing/noteimp.py b/pylib/anki/importing/noteimp.py index 35bb4fa71..8ba0c05cd 100644 --- a/pylib/anki/importing/noteimp.py +++ b/pylib/anki/importing/noteimp.py @@ -21,10 +21,10 @@ from anki.utils import ( timestampID, ) -type_tagsMapped = Tuple[int, int, str, str, NoteID, str, str] -type_tagsModified = Tuple[int, int, str, str, NoteID, str] -type_tagsElse = Tuple[int, int, str, NoteID, str] -type_udpates = Union[type_tagsMapped, type_tagsModified, type_tagsElse] +TagMappedUpdate = Tuple[int, int, str, str, NoteID, str, str] +TagModifiedUpdate = Tuple[int, int, str, str, NoteID, str] +NoTagUpdate = Tuple[int, int, str, NoteID, str] +Updates = Union[TagMappedUpdate, TagModifiedUpdate, NoTagUpdate] # Stores a list of fields, tags and deck ###################################################################### @@ -142,7 +142,7 @@ class NoteImporter(Importer): self._fmap = self.col.models.fieldMap(self.model) self._nextID = NoteID(timestampID(self.col.db, "notes")) # loop through the notes - updates: List[type_udpates] = [] + updates: List[Updates] = [] updateLog = [] new = [] self._ids: List[NoteID] = [] @@ -278,7 +278,7 @@ class NoteImporter(Importer): def updateData( self, n: ForeignNote, id: NoteID, sflds: List[str] - ) -> Optional[type_udpates]: + ) -> Optional[Updates]: self._ids.append(id) self.processFields(n, sflds) if self._tagsMapped: @@ -292,7 +292,7 @@ class NoteImporter(Importer): else: 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()") if self._tagsMapped: self.col.db.executemany(