mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
parent
c39a5e17e8
commit
b85ee30c70
1 changed files with 0 additions and 23 deletions
|
@ -147,28 +147,6 @@ class ProfileManager:
|
||||||
def ensureBaseExists(self) -> None:
|
def ensureBaseExists(self) -> None:
|
||||||
self._ensureExists(self.base)
|
self._ensureExists(self.base)
|
||||||
|
|
||||||
# Folder migration
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def _oldFolderLocation(self) -> str:
|
|
||||||
if isMac:
|
|
||||||
return os.path.expanduser("~/Documents/Anki")
|
|
||||||
elif isWin:
|
|
||||||
from aqt.winpaths import get_personal
|
|
||||||
|
|
||||||
return os.path.join(get_personal(), "Anki")
|
|
||||||
else:
|
|
||||||
p = os.path.expanduser("~/Anki")
|
|
||||||
if os.path.isdir(p):
|
|
||||||
return p
|
|
||||||
return os.path.expanduser("~/Documents/Anki")
|
|
||||||
|
|
||||||
def maybeMigrateFolder(self) -> None:
|
|
||||||
oldBase = self._oldFolderLocation()
|
|
||||||
|
|
||||||
if oldBase and not os.path.exists(self.base) and os.path.isdir(oldBase):
|
|
||||||
shutil.move(oldBase, self.base)
|
|
||||||
|
|
||||||
# Profile load/save
|
# Profile load/save
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
@ -354,7 +332,6 @@ class ProfileManager:
|
||||||
self.base = os.path.abspath(os.environ["ANKI_BASE"])
|
self.base = os.path.abspath(os.environ["ANKI_BASE"])
|
||||||
else:
|
else:
|
||||||
self.base = self._defaultBase()
|
self.base = self._defaultBase()
|
||||||
self.maybeMigrateFolder()
|
|
||||||
self.ensureBaseExists()
|
self.ensureBaseExists()
|
||||||
|
|
||||||
def _defaultBase(self) -> str:
|
def _defaultBase(self) -> str:
|
||||||
|
|
Loading…
Reference in a new issue