Mercurial > p > roundup > code
comparison roundup/backends/back_bsddb3.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 | 091711fb2f8c |
| 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_bsddb3.py,v 1.24 2004-07-02 05:22:09 richard Exp $ | 18 #$Id: back_bsddb3.py,v 1.25 2004-07-27 00:57:18 richard Exp $ |
| 19 '''This module defines a backend that saves the hyperdatabase in BSDDB3. | 19 '''This module defines a backend that saves the hyperdatabase in BSDDB3. |
| 20 ''' | 20 ''' |
| 21 __docformat__ = 'restructuredtext' | 21 __docformat__ = 'restructuredtext' |
| 22 | 22 |
| 23 import bsddb3, os, marshal, errno | 23 import bsddb3, os, marshal, errno, shutil |
| 24 from roundup import hyperdb, date | 24 from roundup import hyperdb, date |
| 25 | 25 |
| 26 # these classes are so similar, we just use the anydbm methods | 26 # these classes are so similar, we just use the anydbm methods |
| 27 from back_anydbm import Database, Class, FileClass, IssueClass | 27 from back_anydbm import Database, Class, FileClass, IssueClass |
| 28 | |
| 29 def db_exists(config): | |
| 30 return os.path.exists(os.path.join(config.TRACKER_HOME, 'db', 'user')) | |
| 31 | |
| 32 def db_nuke(config): | |
| 33 shutil.rmtree(os.path.join(config.TRACKER_HOME, 'db')) | |
| 28 | 34 |
| 29 # | 35 # |
| 30 # Now the database | 36 # Now the database |
| 31 # | 37 # |
| 32 class Database(Database): | 38 class Database(Database): |
