Merge pull request #63 from hssm/986

Remove marked/leech tags when exporting without sched data (#986)
This commit is contained in:
Damien Elmes 2014-02-15 23:43:28 +09:00
commit 8c22e747bb

View file

@ -134,8 +134,14 @@ class AnkiExporter(Exporter):
data)
# notes
strnids = ids2str(nids.keys())
notedata = self.src.db.all("select * from notes where id in "+
strnids)
notedata = []
for row in self.src.db.all(
"select * from notes where id in "+strnids):
# remove system tags if not exporting scheduling info
if not self.includeSched:
row = list(row)
row[5] = self.removeSystemTags(row[5])
notedata.append(row)
self.dst.db.executemany(
"insert into notes values (?,?,?,?,?,?,?,?,?,?,?)",
notedata)
@ -207,6 +213,11 @@ class AnkiExporter(Exporter):
# such as update the deck description
pass
def removeSystemTags(self, tags):
tags = ' '.join(tag for tag in tags.split()
if (tag.lower() != "marked" and tag.lower() != "leech"))
return tags
# Packaged Anki decks
######################################################################