comparison roundup/backends/back_anydbm.py @ 2633:a9e1fff1e793

I thought I committed this last night. Ho hum. - This implements most of the rest of the new tracker config layout: - dbinit.py split between schema.py and initial_data.py - interfaces.py gone - tracker and detectors __init__.py gone - Added some missing functionality to backends: db_exists test and db_nuke. - Implemented configuration file options in postgresql backend. - Cleaned up tracker initialisation a lot.
author Richard Jones <richard@users.sourceforge.net>
date Tue, 27 Jul 2004 00:57:19 +0000
parents 33fffbf7ae68
children 11811b313459
comparison
equal deleted inserted replaced
2632:9c55f2bc5961 2633:a9e1fff1e793
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 #$Id: back_anydbm.py,v 1.166 2004-07-22 04:47:35 richard Exp $ 18 #$Id: back_anydbm.py,v 1.167 2004-07-27 00:57:18 richard Exp $
19 '''This module defines a backend that saves the hyperdatabase in a 19 '''This module defines a backend that saves the hyperdatabase in a
20 database chosen by anydbm. It is guaranteed to always be available in python 20 database chosen by anydbm. It is guaranteed to always be available in python
21 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several 21 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
22 serious bugs, and is not available) 22 serious bugs, and is not available)
23 ''' 23 '''
40 from indexer_dbm import Indexer 40 from indexer_dbm import Indexer
41 from roundup.backends import locking 41 from roundup.backends import locking
42 from roundup.hyperdb import String, Password, Date, Interval, Link, \ 42 from roundup.hyperdb import String, Password, Date, Interval, Link, \
43 Multilink, DatabaseError, Boolean, Number, Node 43 Multilink, DatabaseError, Boolean, Number, Node
44 from roundup.date import Range 44 from roundup.date import Range
45
46 def db_exists(config):
47 # check for the user db
48 for db in 'user user.db'.split():
49 if os.path.exists(os.path.join(config.TRACKER_HOME, 'db', db)):
50 return 1
51 return 0
52
53 def db_nuke(config):
54 shutil.rmtree(os.path.join(config.TRACKER_HOME, 'db'))
45 55
46 # 56 #
47 # Now the database 57 # Now the database
48 # 58 #
49 class Database(FileStorage, hyperdb.Database, roundupdb.Database): 59 class Database(FileStorage, hyperdb.Database, roundupdb.Database):

Roundup Issue Tracker: http://roundup-tracker.org/