comparison roundup/init.py @ 193:241a0323aacb

Used the much nicer load_package, pointed out by Steve Majewski.
author Richard Jones <richard@users.sourceforge.net>
date Fri, 03 Aug 2001 01:28:33 +0000
parents 996eaf90c01e
children 609a9d82218f
comparison
equal deleted inserted replaced
192:01a910e17403 193:241a0323aacb
1 # $Id: init.py,v 1.9 2001-08-03 00:59:34 richard Exp $ 1 # $Id: init.py,v 1.10 2001-08-03 01:28:33 richard Exp $
2 2
3 import os, shutil, sys, errno, imp 3 import os, shutil, sys, errno, imp
4 4
5 def copytree(src, dst, symlinks=0): 5 def copytree(src, dst, symlinks=0):
6 """Recursively copy a directory tree using copy2(). 6 """Recursively copy a directory tree using copy2().
48 db = '''# WARNING: DO NOT EDIT THIS FILE!!! 48 db = '''# WARNING: DO NOT EDIT THIS FILE!!!
49 from roundup.backends.back_%s import Database'''%backend 49 from roundup.backends.back_%s import Database'''%backend
50 open(os.path.join(instance_home, 'select_db.py'), 'w').write(db) 50 open(os.path.join(instance_home, 'select_db.py'), 'w').write(db)
51 51
52 # now import the instance and call its init 52 # now import the instance and call its init
53 instance = imp.load_module('instance', None, instance_home, ('', '', 5)) 53 instance = imp.loa_package('instance', instance_home)
54 instance.init(adminpw) 54 instance.init(adminpw)
55 55
56 # 56 #
57 # $Log: not supported by cvs2svn $ 57 # $Log: not supported by cvs2svn $
58 # Revision 1.9 2001/08/03 00:59:34 richard
59 # Instance import now imports the instance using imp.load_module so that
60 # we can have instance homes of "roundup" or other existing python package
61 # names.
62 #
58 # Revision 1.8 2001/07/29 07:01:39 richard 63 # Revision 1.8 2001/07/29 07:01:39 richard
59 # Added vim command to all source so that we don't get no steenkin' tabs :) 64 # Added vim command to all source so that we don't get no steenkin' tabs :)
60 # 65 #
61 # Revision 1.7 2001/07/28 07:59:53 richard 66 # Revision 1.7 2001/07/28 07:59:53 richard
62 # Replaced errno integers with their module values. 67 # Replaced errno integers with their module values.

Roundup Issue Tracker: http://roundup-tracker.org/