diff --git a/anki/__init__.py b/anki/__init__.py index dab395b4d..a789cc53f 100644 --- a/anki/__init__.py +++ b/anki/__init__.py @@ -28,6 +28,6 @@ if arch[1] == "ELF": sys.path.insert(0, os.path.join(ext, "py2.%d-%s" % ( sys.version_info[1], arch[0][0:2]))) -version="2.0.14" # build scripts grep this line, so preserve formatting +version="2.0.15" # build scripts grep this line, so preserve formatting from anki.storage import Collection __all__ = ["Collection"] diff --git a/anki/find.py b/anki/find.py index a07dd304e..dd0d07c0d 100644 --- a/anki/find.py +++ b/anki/find.py @@ -23,6 +23,7 @@ class Finder(object): deck=self._findDeck, mid=self._findMid, nid=self._findNids, + cid=self._findCids, note=self._findModel, prop=self._findProp, rated=self._findRated, @@ -335,6 +336,11 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds return return "n.id in (%s)" % val + def _findCids(self, (val, args)): + if re.search("[^0-9,]", val): + return + return "c.id in (%s)" % val + def _findMid(self, (val, args)): if re.search("[^0-9]", val): return diff --git a/aqt/main.py b/aqt/main.py index 425080987..46ff38327 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -896,7 +896,7 @@ Difference to correct time: %s.""") % diffText ", ".join([customRepr(x) for x in args])) lpath = re.sub("\.anki2$", ".log", self.pm.collectionPath()) open(lpath, "ab").write(buf.encode("utf8") + "\n") - if os.environ.get("LOG"): + if os.environ.get("ANKIDEV"): print buf # Schema modifications