From 7aee582a58e8c8c854635d9cec4faa10becf1279 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 6 Oct 2013 09:25:04 +0900 Subject: [PATCH] loop should exit early, and allNames() doesn't need modification --- anki/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/anki/models.py b/anki/models.py index fade814b9..8ad5b158d 100644 --- a/anki/models.py +++ b/anki/models.py @@ -124,8 +124,8 @@ class ModelManager(object): "Get all models." return self.models.values() - def allNames(self, curm=None): - return [m['name'] for m in self.all() if m!=curm] + def allNames(self): + return [m['name'] for m in self.all()] def byName(self, name): "Get model with NAME." @@ -171,6 +171,7 @@ select id from cards where nid in (select id from notes where mid = ?)""", if (mcur['name'] == m['name'] and mcur['id'] != m['id']): m['name'] += "-" + checksum(str(time.time()))[:5] + break def update(self, m): "Add or update an existing model. Used for syncing and merging."