Mercurial > p > roundup > code
comparison roundup/templates/classic/dbinit.py @ 602:c242455d9b46 config-0-4-0-branch
Brought the config branch up to date with HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 06 Feb 2002 04:05:55 +0000 |
| parents | a5cd27d33516 |
| children | 13719594278b |
comparison
equal
deleted
inserted
replaced
| 601:912029653c1c | 602:c242455d9b46 |
|---|---|
| 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: dbinit.py,v 1.13.2.1 2002-01-03 02:12:05 titus Exp $ | 18 # $Id: dbinit.py,v 1.13.2.2 2002-02-06 04:05:54 richard Exp $ |
| 19 | 19 |
| 20 import os | 20 import os |
| 21 | 21 |
| 22 import instance_config | 22 import instance_config |
| 23 from roundup import roundupdb | 23 from roundup import roundupdb |
| 33 pass | 33 pass |
| 34 | 34 |
| 35 class IssueClass(roundupdb.IssueClass): | 35 class IssueClass(roundupdb.IssueClass): |
| 36 ''' issues need the email information | 36 ''' issues need the email information |
| 37 ''' | 37 ''' |
| 38 INSTANCE_NAME = instance_config.INSTANCE_NAME | 38 pass |
| 39 ISSUE_TRACKER_WEB = instance_config.ISSUE_TRACKER_WEB | |
| 40 ISSUE_TRACKER_EMAIL = instance_config.ISSUE_TRACKER_EMAIL | |
| 41 ADMIN_EMAIL = instance_config.ADMIN_EMAIL | |
| 42 MAILHOST = instance_config.MAILHOST | |
| 43 MESSAGES_TO_AUTHOR = instance_config.MESSAGES_TO_AUTHOR | |
| 44 EMAIL_SIGNATURE_POSITION = instance_config.EMAIL_SIGNATURE_POSITION | |
| 45 | 39 |
| 46 | 40 |
| 47 def open(name=None): | 41 def open(name=None): |
| 48 ''' as from the roundupdb method openDB | 42 ''' as from the roundupdb method openDB |
| 49 | 43 |
| 50 ''' | 44 ''' |
| 51 from roundup.hyperdb import String, Password, Date, Link, Multilink | 45 from roundup.hyperdb import String, Password, Date, Link, Multilink |
| 52 | 46 |
| 53 # open the database | 47 # open the database |
| 54 db = Database(instance_config.get_default_database_dir(), name) | 48 db = Database(instance_config, name) |
| 55 | 49 |
| 56 # Now initialise the schema. Must do this each time. | 50 # Now initialise the schema. Must do this each time. |
| 57 pri = Class(db, "priority", | 51 pri = Class(db, "priority", |
| 58 name=String(), order=String()) | 52 name=String(), order=String()) |
| 59 pri.setkey("name") | 53 pri.setkey("name") |
| 126 address=instance_config.get_default_admin_email()) | 120 address=instance_config.get_default_admin_email()) |
| 127 db.commit() | 121 db.commit() |
| 128 | 122 |
| 129 # | 123 # |
| 130 # $Log: not supported by cvs2svn $ | 124 # $Log: not supported by cvs2svn $ |
| 125 # Revision 1.14 2002/01/14 02:20:15 richard | |
| 126 # . changed all config accesses so they access either the instance or the | |
| 127 # config attriubute on the db. This means that all config is obtained from | |
| 128 # instance_config instead of the mish-mash of classes. This will make | |
| 129 # switching to a ConfigParser setup easier too, I hope. | |
| 130 # | |
| 131 # At a minimum, this makes migration a _little_ easier (a lot easier in the | |
| 132 # 0.5.0 switch, I hope!) | |
| 133 # | |
| 134 # | |
| 135 # Revision 1.13.2.1 2002/01/03 02:12:05 titus | |
| 136 # | |
| 137 # Initial ConfigParser implementation. | |
| 138 # | |
| 139 # | |
| 131 # Revision 1.13 2002/01/02 02:31:38 richard | 140 # Revision 1.13 2002/01/02 02:31:38 richard |
| 132 # Sorry for the huge checkin message - I was only intending to implement #496356 | 141 # Sorry for the huge checkin message - I was only intending to implement #496356 |
| 133 # but I found a number of places where things had been broken by transactions: | 142 # but I found a number of places where things had been broken by transactions: |
| 134 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename | 143 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename |
| 135 # for _all_ roundup-generated smtp messages to be sent to. | 144 # for _all_ roundup-generated smtp messages to be sent to. |
