mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
Merge pull request #63 from hssm/986
Remove marked/leech tags when exporting without sched data (#986)
This commit is contained in:
commit
8c22e747bb
1 changed files with 13 additions and 2 deletions
|
@ -134,8 +134,14 @@ class AnkiExporter(Exporter):
|
||||||
data)
|
data)
|
||||||
# notes
|
# notes
|
||||||
strnids = ids2str(nids.keys())
|
strnids = ids2str(nids.keys())
|
||||||
notedata = self.src.db.all("select * from notes where id in "+
|
notedata = []
|
||||||
strnids)
|
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(
|
self.dst.db.executemany(
|
||||||
"insert into notes values (?,?,?,?,?,?,?,?,?,?,?)",
|
"insert into notes values (?,?,?,?,?,?,?,?,?,?,?)",
|
||||||
notedata)
|
notedata)
|
||||||
|
@ -206,6 +212,11 @@ class AnkiExporter(Exporter):
|
||||||
# overwrite to apply customizations to the deck before it's closed,
|
# overwrite to apply customizations to the deck before it's closed,
|
||||||
# such as update the deck description
|
# such as update the deck description
|
||||||
pass
|
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
|
# Packaged Anki decks
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
Loading…
Reference in a new issue