stop migrating from old folder locations

Closes #1390
This commit is contained in:
Damien Elmes 2021-10-05 08:57:50 +10:00
parent c39a5e17e8
commit b85ee30c70

View file

@ -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: