Mercurial > p > roundup > code
comparison roundup/init.py @ 208:1894a28a1e66
Added documentation.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 06 Aug 2001 01:20:00 +0000 |
| parents | c1461733cbf9 |
| children | d45384bc6420 |
comparison
equal
deleted
inserted
replaced
| 207:d6326e8ebe6e | 208:1894a28a1e66 |
|---|---|
| 1 # $Id: init.py,v 1.12 2001-08-05 07:43:52 richard Exp $ | 1 # $Id: init.py,v 1.13 2001-08-06 01:20:00 richard Exp $ |
| 2 | 2 |
| 3 import os, shutil, sys, errno | 3 import os, shutil, sys, errno |
| 4 | 4 |
| 5 import roundup.instance | 5 import roundup.instance |
| 6 | 6 |
| 32 copytree(srcname, dstname, symlinks) | 32 copytree(srcname, dstname, symlinks) |
| 33 else: | 33 else: |
| 34 shutil.copy2(srcname, dstname) | 34 shutil.copy2(srcname, dstname) |
| 35 | 35 |
| 36 def init(instance_home, template, backend, adminpw): | 36 def init(instance_home, template, backend, adminpw): |
| 37 ''' initialise an instance using the named template | 37 '''Initialise an instance using the named template and backend. |
| 38 | |
| 39 instance_home - the directory to place the instance data in | |
| 40 template - the template to use in creating the instance data | |
| 41 backend - the database to use to store the instance data | |
| 42 adminpw - the password for the "admin" user | |
| 43 | |
| 44 The instance_home directory will be created using the files found in | |
| 45 the named template (roundup.templates.<name>). A standard instance_home | |
| 46 contains: | |
| 47 . instance_config.py | |
| 48 - simple configuration of things like the email address for the | |
| 49 mail gateway, the mail domain, the mail host, ... | |
| 50 . dbinit.py and select_db.py | |
| 51 - defines the schema for the hyperdatabase and indicates which | |
| 52 backend to use. | |
| 53 . interfaces.py | |
| 54 - defines the CGI Client and mail gateway MailGW classes that are | |
| 55 used by roundup.cgi, roundup-server and roundup-mailgw. | |
| 56 . __init__.py | |
| 57 - ties together all the instance information into one interface | |
| 58 . db/ | |
| 59 - the actual database that stores the instance's data | |
| 60 . html/ | |
| 61 - the html templates that are used by the CGI Client | |
| 62 . detectors/ | |
| 63 - the auditor and reactor modules for this instance | |
| 64 | |
| 65 The html directory is typically extracted from the htmlbase module in | |
| 66 the template. | |
| 38 ''' | 67 ''' |
| 39 # first, copy the template dir over | 68 # first, copy the template dir over |
| 40 import roundup.templatebuilder | 69 import roundup.templatebuilder |
| 41 | 70 |
| 42 template_dir = os.path.split(__file__)[0] | 71 template_dir = os.path.split(__file__)[0] |
| 55 instance = roundup.instance.open(instance_home) | 84 instance = roundup.instance.open(instance_home) |
| 56 instance.init(adminpw) | 85 instance.init(adminpw) |
| 57 | 86 |
| 58 # | 87 # |
| 59 # $Log: not supported by cvs2svn $ | 88 # $Log: not supported by cvs2svn $ |
| 89 # Revision 1.12 2001/08/05 07:43:52 richard | |
| 90 # Instances are now opened by a special function that generates a unique | |
| 91 # module name for the instances on import time. | |
| 92 # | |
| 60 # Revision 1.11 2001/08/04 22:42:43 richard | 93 # Revision 1.11 2001/08/04 22:42:43 richard |
| 61 # Fixed sf.net bug #447671 - typo | 94 # Fixed sf.net bug #447671 - typo |
| 62 # | 95 # |
| 63 # Revision 1.10 2001/08/03 01:28:33 richard | 96 # Revision 1.10 2001/08/03 01:28:33 richard |
| 64 # Used the much nicer load_package, pointed out by Steve Majewski. | 97 # Used the much nicer load_package, pointed out by Steve Majewski. |
