style and arg order fix

This commit is contained in:
Damien Elmes 2019-02-18 12:44:04 +10:00
parent da64f2d7c8
commit d8f059b570
2 changed files with 4 additions and 4 deletions

View File

@ -417,7 +417,7 @@ insert into cards values (?,?,?,?,?,?,0,0,?,0,0,0,0,0,0,0,0,"")""",
# type 0 - when previewing in add dialog, only non-empty # type 0 - when previewing in add dialog, only non-empty
# type 1 - when previewing edit, only existing # type 1 - when previewing edit, only existing
# type 2 - when previewing in models dialog, all templates # type 2 - when previewing in models dialog, all templates
def previewCards(self, note, type=0, did = None): def previewCards(self, note, type=0, did=None):
if type == 0: if type == 0:
cms = self.findTemplates(note) cms = self.findTemplates(note)
elif type == 1: elif type == 1:
@ -428,10 +428,10 @@ insert into cards values (?,?,?,?,?,?,0,0,?,0,0,0,0,0,0,0,0,"")""",
return [] return []
cards = [] cards = []
for template in cms: for template in cms:
cards.append(self._newCard(note, template, 1, flush=False, did = did)) cards.append(self._newCard(note, template, 1, flush=False, did=did))
return cards return cards
def _newCard(self, note, template, due, did = None, flush=True): def _newCard(self, note, template, due, flush=True, did=None):
"Create a new card." "Create a new card."
card = anki.cards.Card(self) card = anki.cards.Card(self)
card.nid = note.id card.nid = note.id

View File

@ -64,7 +64,7 @@ class CardLayout(QDialog):
did = None did = None
if hasattr(self.parent,"deckChooser"): if hasattr(self.parent,"deckChooser"):
did = self.parent.deckChooser.selectedId() did = self.parent.deckChooser.selectedId()
self.cards = self.col.previewCards(self.note, 2, did = did) self.cards = self.col.previewCards(self.note, 2, did=did)
idx = self.ord idx = self.ord
if idx >= len(self.cards): if idx >= len(self.cards):
self.ord = len(self.cards) - 1 self.ord = len(self.cards) - 1