mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
obsolete code in tags.py
This commit is contained in:
parent
ca7662ba72
commit
b8ceef1b4a
1 changed files with 0 additions and 30 deletions
30
anki/tags.py
30
anki/tags.py
|
@ -151,36 +151,6 @@ class TagManager(object):
|
|||
"True if TAG is in TAGS. Ignore case."
|
||||
return tag.lower() in [t.lower() for t in tags]
|
||||
|
||||
# Tag-based selective study
|
||||
##########################################################################
|
||||
|
||||
def selTagNids(self, yes, no):
|
||||
# find notes that match yes
|
||||
lim = ""
|
||||
args = []
|
||||
query = "select id from notes"
|
||||
if not yes and not no:
|
||||
pass
|
||||
else:
|
||||
if yes:
|
||||
lim += " or ".join(["tags like ?" for t in yes])
|
||||
args += ['%% %s %%' % t for t in yes]
|
||||
if no:
|
||||
lim2 = " and ".join(["tags not like ?" for t in no])
|
||||
if lim:
|
||||
lim = "(%s) and %s" % (lim, lim2)
|
||||
else:
|
||||
lim = lim2
|
||||
args += ['%% %s %%' % t for t in no]
|
||||
query += " where " + lim
|
||||
return self.col.db.list(query, *args)
|
||||
|
||||
def setDeckForTags(self, yes, no, did):
|
||||
nids = self.selTagNids(yes, no)
|
||||
self.col.db.execute(
|
||||
"update cards set did=?,mod=?,usn=? where nid in "+ids2str(nids),
|
||||
did, intTime(), self.col.usn())
|
||||
|
||||
# Sync handling
|
||||
##########################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue