mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
make sure to remove deck if exists before exporting into it
This commit is contained in:
parent
04ba9c9a4e
commit
187caa874b
1 changed files with 5 additions and 1 deletions
|
@ -8,7 +8,7 @@ Exporting support
|
|||
"""
|
||||
__docformat__ = 'restructuredtext'
|
||||
|
||||
import itertools, time, re
|
||||
import itertools, time, re, os
|
||||
from operator import itemgetter
|
||||
from anki import DeckStorage
|
||||
from anki.cards import Card
|
||||
|
@ -77,6 +77,10 @@ class AnkiExporter(Exporter):
|
|||
n += 1
|
||||
self.deck.startProgress(n)
|
||||
self.deck.updateProgress(_("Exporting..."))
|
||||
try:
|
||||
os.unlink(path)
|
||||
except (IOError, OSError):
|
||||
pass
|
||||
self.newDeck = DeckStorage.Deck(path)
|
||||
client = SyncClient(self.deck)
|
||||
server = SyncServer(self.newDeck)
|
||||
|
|
Loading…
Reference in a new issue