X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=roundup%2Finit.py;h=b0e2b5b8bc03f0e38078dc3276f84f76e3541347;hb=f808f23ddce3ea66fe19b632d904c64e3aba5971;hp=b41561c4d1e4dd53e022d8e951230ea896751a29;hpb=d41bd8697d416b2ae31bce688a72fc67f97a89f1;p=roundup.git diff --git a/roundup/init.py b/roundup/init.py index b41561c..b0e2b5b 100644 --- a/roundup/init.py +++ b/roundup/init.py @@ -15,14 +15,19 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: init.py,v 1.15 2001-08-07 00:24:42 richard Exp $ +# $Id: init.py,v 1.24 2002-09-10 12:44:42 richard Exp $ -import os, shutil, sys, errno +__doc__ = """ +Init (create) a roundup instance. +""" -import roundup.instance +import os, sys, errno + +import roundup.instance, password +from roundup import install_util def copytree(src, dst, symlinks=0): - """Recursively copy a directory tree using copy2(). + """Recursively copy a directory tree using copyDigestedFile(). The destination directory os allowed to exist. @@ -31,7 +36,7 @@ def copytree(src, dst, symlinks=0): it is false, the contents of the files pointed to by symbolic links are copied. - XXX copied from shutil.py in std lib + This was copied from shutil.py in std lib. """ names = os.listdir(src) @@ -48,20 +53,19 @@ def copytree(src, dst, symlinks=0): elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks) else: - shutil.copy2(srcname, dstname) + install_util.copyDigestedFile(srcname, dstname) -def init(instance_home, template, backend, adminpw): - '''Initialise an instance using the named template and backend. +def install(instance_home, template, backend): + '''Install an instance using the named template and backend. instance_home - the directory to place the instance data in template - the template to use in creating the instance data backend - the database to use to store the instance data - adminpw - the password for the "admin" user The instance_home directory will be created using the files found in the named template (roundup.templates.). A standard instance_home contains: - . instance_config.py + . config.py - simple configuration of things like the email address for the mail gateway, the mail domain, the mail host, ... . dbinit.py and select_db.py @@ -83,76 +87,30 @@ def init(instance_home, template, backend, adminpw): the template. ''' # first, copy the template dir over - import roundup.templatebuilder + from roundup.templates import builder + # copy the roundup.templates.