mirror of
https://github.com/ankitects/anki.git
synced 2025-12-31 07:43:02 -05:00
fix crash when documents folder on separate filesystem
also get rid of the Documents/Anki symlink, as the symlink doesn't sync across systems, and is liable to cause confusion in the future
This commit is contained in:
parent
0cb983d2f4
commit
478c164bf9
1 changed files with 6 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ import random
|
||||||
import cPickle
|
import cPickle
|
||||||
import locale
|
import locale
|
||||||
import re
|
import re
|
||||||
|
import shutil
|
||||||
|
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from anki.db import DB
|
from anki.db import DB
|
||||||
|
|
@ -104,8 +105,11 @@ a flash drive.""" % self.base)
|
||||||
return
|
return
|
||||||
oldBase = os.path.expanduser("~/Documents/Anki")
|
oldBase = os.path.expanduser("~/Documents/Anki")
|
||||||
if not os.path.exists(self.base) and os.path.exists(oldBase):
|
if not os.path.exists(self.base) and os.path.exists(oldBase):
|
||||||
os.rename(oldBase, self.base)
|
shutil.move(oldBase, self.base)
|
||||||
os.symlink(self.base, oldBase)
|
|
||||||
|
# remove the old symlink if it exists
|
||||||
|
if os.path.exists(oldBase) and os.path.islink(oldBase):
|
||||||
|
os.remove(oldBase)
|
||||||
|
|
||||||
# Profile load/save
|
# Profile load/save
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue