Mercurial > p > roundup > code
comparison roundup/init.py @ 388:2d92f93072f9
Code using copyDigestedFile() that passes unit tests
| author | Jürgen Hermann <jhermann@users.sourceforge.net> |
|---|---|
| date | Mon, 12 Nov 2001 23:17:38 +0000 |
| parents | a4241ddd22d7 |
| children | bdc2ea127ae9 |
comparison
equal
deleted
inserted
replaced
| 387:c066d3c91728 | 388:2d92f93072f9 |
|---|---|
| 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: init.py,v 1.16 2001-10-09 07:25:59 richard Exp $ | 18 # $Id: init.py,v 1.17 2001-11-12 23:17:38 jhermann Exp $ |
| 19 | 19 |
| 20 import os, shutil, sys, errno | 20 import os, sys, errno |
| 21 | 21 |
| 22 import roundup.instance, password | 22 import roundup.instance, password |
| 23 from roundup import install_util | |
| 23 | 24 |
| 24 def copytree(src, dst, symlinks=0): | 25 def copytree(src, dst, symlinks=0): |
| 25 """Recursively copy a directory tree using copy2(). | 26 """Recursively copy a directory tree using copyDigestedFile(). |
| 26 | 27 |
| 27 The destination directory os allowed to exist. | 28 The destination directory os allowed to exist. |
| 28 | 29 |
| 29 If the optional symlinks flag is true, symbolic links in the | 30 If the optional symlinks flag is true, symbolic links in the |
| 30 source tree result in symbolic links in the destination tree; if | 31 source tree result in symbolic links in the destination tree; if |
| 46 linkto = os.readlink(srcname) | 47 linkto = os.readlink(srcname) |
| 47 os.symlink(linkto, dstname) | 48 os.symlink(linkto, dstname) |
| 48 elif os.path.isdir(srcname): | 49 elif os.path.isdir(srcname): |
| 49 copytree(srcname, dstname, symlinks) | 50 copytree(srcname, dstname, symlinks) |
| 50 else: | 51 else: |
| 51 shutil.copy2(srcname, dstname) | 52 install_util.copyDigestedFile(srcname, dstname) |
| 52 | 53 |
| 53 def init(instance_home, template, backend, adminpw): | 54 def init(instance_home, template, backend, adminpw): |
| 54 '''Initialise an instance using the named template and backend. | 55 '''Initialise an instance using the named template and backend. |
| 55 | 56 |
| 56 instance_home - the directory to place the instance data in | 57 instance_home - the directory to place the instance data in |
| 101 instance = roundup.instance.open(instance_home) | 102 instance = roundup.instance.open(instance_home) |
| 102 instance.init(password.Password(adminpw)) | 103 instance.init(password.Password(adminpw)) |
| 103 | 104 |
| 104 # | 105 # |
| 105 # $Log: not supported by cvs2svn $ | 106 # $Log: not supported by cvs2svn $ |
| 107 # Revision 1.16 2001/10/09 07:25:59 richard | |
| 108 # Added the Password property type. See "pydoc roundup.password" for | |
| 109 # implementation details. Have updated some of the documentation too. | |
| 110 # | |
| 106 # Revision 1.15 2001/08/07 00:24:42 richard | 111 # Revision 1.15 2001/08/07 00:24:42 richard |
| 107 # stupid typo | 112 # stupid typo |
| 108 # | 113 # |
| 109 # Revision 1.14 2001/08/07 00:15:51 richard | 114 # Revision 1.14 2001/08/07 00:15:51 richard |
| 110 # Added the copyright/license notice to (nearly) all files at request of | 115 # Added the copyright/license notice to (nearly) all files at request of |
