mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
fix config
This commit is contained in:
parent
fc8b3ab3f0
commit
c525d81264
1 changed files with 9 additions and 7 deletions
|
@ -31,11 +31,9 @@ class Config(dict):
|
||||||
"~/Library/Application Support/Anki")
|
"~/Library/Application Support/Anki")
|
||||||
# upgrade?
|
# upgrade?
|
||||||
if os.path.exists(oldDb):
|
if os.path.exists(oldDb):
|
||||||
if not os.path.exists(self.configPath):
|
|
||||||
self.makeAnkiDir()
|
self.makeAnkiDir()
|
||||||
newDb = self.getDbPath()
|
newDb = self.getDbPath()
|
||||||
os.rename(oldDb, newDb)
|
os.rename(oldDb, newDb)
|
||||||
if not os.path.exists(self.configPath):
|
|
||||||
self.makeAnkiDir()
|
self.makeAnkiDir()
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
|
@ -104,9 +102,13 @@ class Config(dict):
|
||||||
|
|
||||||
def makeAnkiDir(self):
|
def makeAnkiDir(self):
|
||||||
base = self.configPath
|
base = self.configPath
|
||||||
os.mkdir(base)
|
for x in (base,
|
||||||
os.mkdir(os.path.join(base, "plugins"))
|
os.path.join(base, "plugins"),
|
||||||
os.mkdir(os.path.join(base, "backups"))
|
os.path.join(base, "backups")):
|
||||||
|
try:
|
||||||
|
os.mkdir(x)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
path = self.getDbPath()
|
path = self.getDbPath()
|
||||||
|
|
Loading…
Reference in a new issue