From 7baea6935ea0874611788fc7f77b10ed9b6a2538 Mon Sep 17 00:00:00 2001 From: gmcm Date: Thu, 26 Sep 2002 13:39:37 +0000 Subject: [PATCH] Add clearCache method to DB. Create config.DATABASE directory if it doesn't exist. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1267 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/backends/back_metakit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roundup/backends/back_metakit.py b/roundup/backends/back_metakit.py index eeb93db..e9a5fe2 100755 --- a/roundup/backends/back_metakit.py +++ b/roundup/backends/back_metakit.py @@ -89,6 +89,9 @@ class _Database(hyperdb.Database): self.tables = self._db.view('tables') self.indexer.datadb = self._db self.dirty = 0 + def clearCache(self): + for cl in self.classes.values(): + cl._commit() def clear(self): for cl in self.classes.values(): cl._clear() @@ -181,6 +184,8 @@ class _Database(hyperdb.Database): # --- internal def __open(self): + if not os.path.exists(self.config.DATABASE): + os.makedirs(self.config.DATABASE) self.dbnm = db = os.path.join(self.config.DATABASE, 'tracker.mk4') lockfilenm = db[:-3]+'lck' self.lockfile = locking.acquire_lock(lockfilenm) -- 2.30.2