strip angle brackets from syncName when downloading

This commit is contained in:
Damien Elmes 2010-02-06 01:27:46 +09:00
parent a374246fba
commit fb6d5a8556

View file

@ -2142,12 +2142,11 @@ it to your friends.
self.mainWin.buttonStack.show() self.mainWin.buttonStack.show()
if self.loadAfterSync: if self.loadAfterSync:
if self.loadAfterSync == 2: if self.loadAfterSync == 2:
p = os.path.join(self.documentDir, name = re.sub("[<>]", "", self.syncName)
self.syncName + ".anki") p = os.path.join(self.documentDir, name + ".anki")
if os.path.exists(p): if os.path.exists(p):
p = os.path.join(self.documentDir, p = os.path.join(self.documentDir,
self.syncName + "%d.anki" name + "%d.anki" % time.time())
% time.time())
shutil.copy2(self.deckPath, p) shutil.copy2(self.deckPath, p)
self.deckPath = p self.deckPath = p
self.loadDeck(self.deckPath, sync=False) self.loadDeck(self.deckPath, sync=False)