Merge pull request #29 from ospalh/fixes

Three fixes
This commit is contained in:
Damien Elmes 2012-10-18 18:53:06 -07:00
commit 2582e70031
2 changed files with 3 additions and 4 deletions

View file

@ -1130,8 +1130,7 @@ update cards set usn=?, mod=?, did=? where odid=0 and id in """ + ids2str(
field, field,
frm.ignoreCase.isChecked()) frm.ignoreCase.isChecked())
except sre_constants.error: except sre_constants.error:
ui.utils.showInfo(_("Invalid regular expression."), showInfo(_("Invalid regular expression."), parent=self)
parent=self)
return return
else: else:
self.onSearch() self.onSearch()

View file

@ -3,7 +3,7 @@
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from aqt.qt import * from aqt.qt import *
import re, os, sys, urllib2, ctypes, traceback, urllib2 import re, os, sys, urllib2, ctypes, traceback
from anki.utils import stripHTML, isWin, isMac, namedtmp, json from anki.utils import stripHTML, isWin, isMac, namedtmp, json
from anki.sound import play from anki.sound import play
from anki.hooks import runHook, runFilter from anki.hooks import runHook, runFilter
@ -789,7 +789,7 @@ please click the help button."""), help="cloze")
if canDelete and self.mw.pm.profile['deleteMedia']: if canDelete and self.mw.pm.profile['deleteMedia']:
if os.path.abspath(name) != os.path.abspath(path): if os.path.abspath(name) != os.path.abspath(path):
try: try:
os.unlink(old) os.unlink(path)
except: except:
pass pass
# return a local html link # return a local html link