fix inconsistent indentation

This commit is contained in:
Damien Elmes 2019-03-04 16:54:22 +10:00
parent 5185e817fc
commit 4037a034aa
10 changed files with 104 additions and 105 deletions

View file

@ -116,7 +116,7 @@ class SupermemoXmlImporter(NoteImporter):
self.notes = []
## TOOLS
## TOOLS
def _fudgeText(self, text):
"Replace sm syntax to Anki syntax"
@ -163,7 +163,7 @@ class SupermemoXmlImporter(NoteImporter):
return ef
## DEFAULT IMPORTER METHODS
## DEFAULT IMPORTER METHODS
def foreignNotes(self):
@ -184,7 +184,7 @@ class SupermemoXmlImporter(NoteImporter):
def fields(self):
return 2
## PARSER METHODS
## PARSER METHODS
def addItemToCards(self,item):
"This method actually do conversion"
@ -433,15 +433,15 @@ class SupermemoXmlImporter(NoteImporter):
#if __name__ == '__main__':
# for testing you can start it standalone
# for testing you can start it standalone
#file = u'/home/epcim/hg2g/dev/python/sm2anki/ADVENG2EXP.xxe.esc.zaloha_FINAL.xml'
#file = u'/home/epcim/hg2g/dev/python/anki/libanki/tests/importing/supermemo/original_ENGLISHFORBEGGINERS_noOEM.xml'
#file = u'/home/epcim/hg2g/dev/python/anki/libanki/tests/importing/supermemo/original_ENGLISHFORBEGGINERS_oem_1250.xml'
#file = str(sys.argv[1])
#impo = SupermemoXmlImporter(Deck(),file)
#impo.foreignCards()
#file = u'/home/epcim/hg2g/dev/python/sm2anki/ADVENG2EXP.xxe.esc.zaloha_FINAL.xml'
#file = u'/home/epcim/hg2g/dev/python/anki/libanki/tests/importing/supermemo/original_ENGLISHFORBEGGINERS_noOEM.xml'
#file = u'/home/epcim/hg2g/dev/python/anki/libanki/tests/importing/supermemo/original_ENGLISHFORBEGGINERS_oem_1250.xml'
#file = str(sys.argv[1])
#impo = SupermemoXmlImporter(Deck(),file)
#impo.foreignCards()
#sys.exit(1)
#sys.exit(1)
# vim: ts=4 sts=2 ft=python

View file

@ -168,8 +168,7 @@ select id from cards where nid in (select id from notes where mid = ?)""",
def ensureNameUnique(self, m):
for mcur in self.all():
if (mcur['name'] == m['name'] and
mcur['id'] != m['id']):
if (mcur['name'] == m['name'] and mcur['id'] != m['id']):
m['name'] += "-" + checksum(str(time.time()))[:5]
break