Mercurial > p > roundup > code
diff 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 |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Tue Jul 27 00:45:49 2004 +0000 +++ b/roundup/backends/back_anydbm.py Tue Jul 27 00:57:19 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.166 2004-07-22 04:47:35 richard Exp $ +#$Id: back_anydbm.py,v 1.167 2004-07-27 00:57:18 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 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several @@ -43,6 +43,16 @@ Multilink, DatabaseError, Boolean, Number, Node from roundup.date import Range +def db_exists(config): + # check for the user db + for db in 'user user.db'.split(): + if os.path.exists(os.path.join(config.TRACKER_HOME, 'db', db)): + return 1 + return 0 + +def db_nuke(config): + shutil.rmtree(os.path.join(config.TRACKER_HOME, 'db')) + # # Now the database #
