Mercurial > p > roundup > code
comparison roundup/init.py @ 113:2ab86442799a
Replaced errno integers with their module values.
De-tabbed templatebuilder.py
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sat, 28 Jul 2001 07:59:53 +0000 |
| parents | d95a03480fd1 |
| children | 0791d13baea7 |
comparison
equal
deleted
inserted
replaced
| 112:e4170b2b2561 | 113:2ab86442799a |
|---|---|
| 1 # $Id: init.py,v 1.6 2001-07-24 11:18:25 anthonybaxter Exp $ | 1 # $Id: init.py,v 1.7 2001-07-28 07:59:53 richard Exp $ |
| 2 | 2 |
| 3 import os, shutil, sys | 3 import os, shutil, sys, errno |
| 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(). |
| 7 | 7 |
| 8 The destination directory os allowed to exist. | 8 The destination directory os allowed to exist. |
| 17 """ | 17 """ |
| 18 names = os.listdir(src) | 18 names = os.listdir(src) |
| 19 try: | 19 try: |
| 20 os.mkdir(dst) | 20 os.mkdir(dst) |
| 21 except OSError, error: | 21 except OSError, error: |
| 22 if error.errno != 17: raise | 22 if error.errno != errno.EEXIST: raise |
| 23 for name in names: | 23 for name in names: |
| 24 srcname = os.path.join(src, name) | 24 srcname = os.path.join(src, name) |
| 25 dstname = os.path.join(dst, name) | 25 dstname = os.path.join(dst, name) |
| 26 if symlinks and os.path.islink(srcname): | 26 if symlinks and os.path.islink(srcname): |
| 27 linkto = os.readlink(srcname) | 27 linkto = os.readlink(srcname) |
| 55 instance = __import__(instance) | 55 instance = __import__(instance) |
| 56 instance.init(adminpw) | 56 instance.init(adminpw) |
| 57 | 57 |
| 58 # | 58 # |
| 59 # $Log: not supported by cvs2svn $ | 59 # $Log: not supported by cvs2svn $ |
| 60 # Revision 1.6 2001/07/24 11:18:25 anthonybaxter | |
| 61 # oops. left a print in | |
| 62 # | |
| 60 # Revision 1.5 2001/07/24 10:54:11 anthonybaxter | 63 # Revision 1.5 2001/07/24 10:54:11 anthonybaxter |
| 61 # oops. Html. | 64 # oops. Html. |
| 62 # | 65 # |
| 63 # Revision 1.4 2001/07/24 10:46:22 anthonybaxter | 66 # Revision 1.4 2001/07/24 10:46:22 anthonybaxter |
| 64 # Added templatebuilder module. two functions - one to pack up the html base, | 67 # Added templatebuilder module. two functions - one to pack up the html base, |
