Code

oops. left a print in
[roundup.git] / roundup / init.py
index 5e2d31ca5ab5e56daa5a2b64b0b2e7d103378a6b..946d93c5b83f2257b79e5add85c7c6cddf290a4a 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: init.py,v 1.2 2001-07-22 12:09:32 richard Exp $
+# $Id: init.py,v 1.6 2001-07-24 11:18:25 anthonybaxter Exp $
 
 import os, shutil, sys
 
@@ -31,14 +31,24 @@ def copytree(src, dst, symlinks=0):
         else:
             shutil.copy2(srcname, dstname)
 
-def init(instance, template, adminpw):
+def init(instance, template, backend, adminpw):
     ''' initialise an instance using the named template
     '''
     # first, copy the template dir over
+    import roundup.templatebuilder
+
     template_dir = os.path.split(__file__)[0]
+    template_name = template
     template = os.path.join(template_dir, 'templates', template)
     copytree(template, instance)
 
+    roundup.templatebuilder.installHtmlBase(template_name, instance)
+
+    # now select database
+    db = '''# WARNING: DO NOT EDIT THIS FILE!!!
+from roundup.backends.back_%s import Database'''%backend
+    open(os.path.join(instance, 'select_db.py'), 'w').write(db)
+
     # now import the instance and call its init
     path, instance = os.path.split(instance)
     sys.path.insert(0, path)
@@ -47,4 +57,23 @@ def init(instance, template, adminpw):
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.5  2001/07/24 10:54:11  anthonybaxter
+# oops. Html.
+#
+# Revision 1.4  2001/07/24 10:46:22  anthonybaxter
+# Added templatebuilder module. two functions - one to pack up the html base,
+# one to unpack it. Packed up the two standard templates into htmlbases.
+# Modified __init__ to install them.
+#
+# __init__.py magic was needed for the rather high levels of wierd import magic.
+# Reducing level of import magic == (good, future)
+#
+# Revision 1.3  2001/07/23 08:45:28  richard
+# ok, so now "./roundup-admin init" will ask questions in an attempt to get a
+# workable instance_home set up :)
+# _and_ anydbm has had its first test :)
+#
+# Revision 1.2  2001/07/22 12:09:32  richard
+# Final commit of Grande Splite
+#
 #