mirror of
https://github.com/ankitects/anki.git
synced 2025-12-11 13:56:55 -05:00
enable v2 apkg export
This commit is contained in:
parent
1afac2492b
commit
b9280ca31e
2 changed files with 2 additions and 13 deletions
|
|
@ -26,7 +26,7 @@ class AnkiPackageImporter(Anki2Importer):
|
||||||
suffix = ".anki2"
|
suffix = ".anki2"
|
||||||
|
|
||||||
col = z.read("collection" + suffix)
|
col = z.read("collection" + suffix)
|
||||||
colpath = tmpfile(suffix=suffix)
|
colpath = tmpfile(suffix=".anki2")
|
||||||
with open(colpath, "wb") as f:
|
with open(colpath, "wb") as f:
|
||||||
f.write(col)
|
f.write(col)
|
||||||
self.file = colpath
|
self.file = colpath
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ from anki import hooks
|
||||||
from anki.exporting import exporters
|
from anki.exporting import exporters
|
||||||
from anki.lang import _, ngettext
|
from anki.lang import _, ngettext
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from aqt.utils import checkInvalidFilename, getSaveFile, showInfo, showWarning, tooltip
|
from aqt.utils import checkInvalidFilename, getSaveFile, showWarning, tooltip
|
||||||
|
|
||||||
|
|
||||||
class ExportDialog(QDialog):
|
class ExportDialog(QDialog):
|
||||||
|
|
@ -104,17 +104,6 @@ class ExportDialog(QDialog):
|
||||||
deck_name = self.decks[self.frm.deck.currentIndex()]
|
deck_name = self.decks[self.frm.deck.currentIndex()]
|
||||||
deck_name = re.sub('[\\\\/?<>:*|"^]', "_", deck_name)
|
deck_name = re.sub('[\\\\/?<>:*|"^]', "_", deck_name)
|
||||||
|
|
||||||
if (
|
|
||||||
not self.isVerbatim
|
|
||||||
and self.isApkg
|
|
||||||
and self.exporter.includeSched
|
|
||||||
and self.col.schedVer() == 2
|
|
||||||
):
|
|
||||||
showInfo(
|
|
||||||
"Please switch to the regular scheduler before exporting a single deck .apkg with scheduling."
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
filename = "{0}{1}".format(deck_name, self.exporter.ext)
|
filename = "{0}{1}".format(deck_name, self.exporter.ext)
|
||||||
while 1:
|
while 1:
|
||||||
file = getSaveFile(
|
file = getSaveFile(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue