summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c68837)
raw | patch | inline | side by side (parent: 6c68837)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 10 Nov 2003 03:56:39 +0000 (03:56 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 10 Nov 2003 03:56:39 +0000 (03:56 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1973 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_anydbm.py | patch | blob | history | |
templates/classic/dbinit.py | patch | blob | history | |
test/db_test_base.py | patch | blob | history |
index 8dae659eca3ce4294aa0c38831a4a180e507cafc..61f2226b86717dfd919b15e3050c9cc05cb37249 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: back_anydbm.py,v 1.129 2003-10-07 11:58:57 anthonybaxter Exp $
+#$Id: back_anydbm.py,v 1.130 2003-11-10 03:56:39 richard Exp $
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
# keep a handle to all the database files opened
self.databases = {}
- # now, do all the transactions
- reindex = {}
- for method, args in self.transactions:
- reindex[method(*args)] = 1
-
- # now close all the database files
- for db in self.databases.values():
- db.close()
- del self.databases
+ try:
+ # now, do all the transactions
+ reindex = {}
+ for method, args in self.transactions:
+ reindex[method(*args)] = 1
+ finally:
+ # make sure we close all the database files
+ for db in self.databases.values():
+ db.close()
+ del self.databases
# reindex the nodes that request it
for classname, nodeid in filter(None, reindex.keys()):
index f7849ce25f9451ee222f1eb716ff057037bb4d0a..8905e3cac7667971fd20a53f26b7b36b53984c63 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: dbinit.py,v 1.1 2003-04-17 03:26:03 richard Exp $
+# $Id: dbinit.py,v 1.2 2003-11-10 03:56:39 richard Exp $
import os
# haven't initialised the database with the admin "initialise" command
db.commit()
+ db.close()
# vim: set filetype=python ts=4 sw=4 et si
diff --git a/test/db_test_base.py b/test/db_test_base.py
index 0e0b45c2144c5bec95334512103f8e303a1b18e2..544db1a7db7d1a61dbd7a1873fdec1fdf3919532 100644 (file)
--- a/test/db_test_base.py
+++ b/test/db_test_base.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: db_test_base.py,v 1.4 2003-11-05 21:54:57 jlgijsbers Exp $
+# $Id: db_test_base.py,v 1.5 2003-11-10 03:56:39 richard Exp $
import unittest, os, shutil, errno, imp, sys, time
class ClassicInitTest(unittest.TestCase):
count = 0
db = None
+ extra_config = ''
def setUp(self):
ClassicInitTest.count = ClassicInitTest.count + 1