catch v2 sched export before file created

https://anki.tenderapp.com/discussions/beta-testing/1210-scheduling-error#comment_45692960
This commit is contained in:
Damien Elmes 2018-07-23 12:01:45 +10:00
parent 475e2ab398
commit a9f69b329f

View File

@ -7,7 +7,7 @@ import re
from aqt.qt import *
import aqt
from aqt.utils import getSaveFile, tooltip, showWarning, askUser, \
checkInvalidFilename
checkInvalidFilename, showInfo
from anki.exporting import exporters
from anki.hooks import addHook, remHook
from anki.lang import ngettext
@ -85,6 +85,10 @@ class ExportDialog(QDialog):
deck_name = self.decks[self.frm.deck.currentIndex()]
deck_name = re.sub('[\\\\/?<>:*|"^]', '_', deck_name)
if not self.isVerbatim and self.isApkg and self.exporter.includeSched:
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)
while 1:
file = getSaveFile(self, _("Export"), "export",