From c525d81264b5861a2b62490a49597257091fd159 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 15 Nov 2008 21:28:34 +0900 Subject: [PATCH] fix config --- ankiqt/config.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ankiqt/config.py b/ankiqt/config.py index 9c92f40e2..820323833 100644 --- a/ankiqt/config.py +++ b/ankiqt/config.py @@ -31,12 +31,10 @@ class Config(dict): "~/Library/Application Support/Anki") # upgrade? if os.path.exists(oldDb): - if not os.path.exists(self.configPath): - self.makeAnkiDir() + self.makeAnkiDir() newDb = self.getDbPath() os.rename(oldDb, newDb) - if not os.path.exists(self.configPath): - self.makeAnkiDir() + self.makeAnkiDir() self.load() def defaults(self): @@ -104,9 +102,13 @@ class Config(dict): def makeAnkiDir(self): base = self.configPath - os.mkdir(base) - os.mkdir(os.path.join(base, "plugins")) - os.mkdir(os.path.join(base, "backups")) + for x in (base, + os.path.join(base, "plugins"), + os.path.join(base, "backups")): + try: + os.mkdir(x) + except: + pass def save(self): path = self.getDbPath()