mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
fix unicode issues with cram and open online
This commit is contained in:
parent
b9c765e7b9
commit
4a268fcfc0
1 changed files with 2 additions and 2 deletions
|
@ -754,7 +754,7 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
|
||||||
self.ensureSyncParams()
|
self.ensureSyncParams()
|
||||||
if not self.saveAndClose(hideWelcome=True): return
|
if not self.saveAndClose(hideWelcome=True): return
|
||||||
# we need a disk-backed file for syncing
|
# we need a disk-backed file for syncing
|
||||||
dir = tempfile.mkdtemp()
|
dir = unicode(tempfile.mkdtemp(), sys.getfilesystemencoding())
|
||||||
path = os.path.join(dir, u"untitled.anki")
|
path = os.path.join(dir, u"untitled.anki")
|
||||||
self.onNew(path=path)
|
self.onNew(path=path)
|
||||||
# ensure all changes come to us
|
# ensure all changes come to us
|
||||||
|
@ -1321,13 +1321,13 @@ day = :d""", d=yesterday)
|
||||||
s = unicode(s)
|
s = unicode(s)
|
||||||
self.deck.save()
|
self.deck.save()
|
||||||
# open tmp deck
|
# open tmp deck
|
||||||
import tempfile
|
|
||||||
ndir = tempfile.mkdtemp(prefix="anki-cram")
|
ndir = tempfile.mkdtemp(prefix="anki-cram")
|
||||||
path = os.path.join(ndir, "cram.anki")
|
path = os.path.join(ndir, "cram.anki")
|
||||||
from anki.exporting import AnkiExporter
|
from anki.exporting import AnkiExporter
|
||||||
e = AnkiExporter(self.deck)
|
e = AnkiExporter(self.deck)
|
||||||
if s:
|
if s:
|
||||||
e.limitTags = parseTags(s)
|
e.limitTags = parseTags(s)
|
||||||
|
path = unicode(path, sys.getfilesystemencoding())
|
||||||
e.exportInto(path)
|
e.exportInto(path)
|
||||||
if not e.exportedCards:
|
if not e.exportedCards:
|
||||||
ui.utils.showInfo(_("No cards matched the provided tags."))
|
ui.utils.showInfo(_("No cards matched the provided tags."))
|
||||||
|
|
Loading…
Reference in a new issue