Mercurial > p > roundup > code
comparison roundup/init.py @ 4026:c8b0a23ba38d
Fix issue2550493: hide 'hidden' files.
| author | Stefan Seefeld <stefan@seefeld.name> |
|---|---|
| date | Mon, 09 Feb 2009 17:47:12 +0000 |
| parents | 3876b94ffe8c |
| children | 4498f5252f8b a0be2bc223f5 |
comparison
equal
deleted
inserted
replaced
| 4020:4a195c5759fe | 4026:c8b0a23ba38d |
|---|---|
| 28 from roundup.i18n import _ | 28 from roundup.i18n import _ |
| 29 | 29 |
| 30 def copytree(src, dst, symlinks=0): | 30 def copytree(src, dst, symlinks=0): |
| 31 """Recursively copy a directory tree using copyDigestedFile(). | 31 """Recursively copy a directory tree using copyDigestedFile(). |
| 32 | 32 |
| 33 The destination directory os allowed to exist. | 33 The destination directory is allowed to exist. |
| 34 | 34 |
| 35 If the optional symlinks flag is true, symbolic links in the | 35 If the optional symlinks flag is true, symbolic links in the |
| 36 source tree result in symbolic links in the destination tree; if | 36 source tree result in symbolic links in the destination tree; if |
| 37 it is false, the contents of the files pointed to by symbolic | 37 it is false, the contents of the files pointed to by symbolic |
| 38 links are copied. | 38 links are copied. |
| 39 | 39 |
| 40 This was copied from shutil.py in std lib. | 40 This was copied from shutil.py in std lib. |
| 41 """ | 41 """ |
| 42 names = os.listdir(src) | 42 |
| 43 # Prevent 'hidden' files (those starting with '.') from being considered. | |
| 44 names = [f for f in os.listdir(src) if not f.startswith('.')] | |
| 43 try: | 45 try: |
| 44 os.mkdir(dst) | 46 os.mkdir(dst) |
| 45 except OSError, error: | 47 except OSError, error: |
| 46 if error.errno != errno.EEXIST: raise | 48 if error.errno != errno.EEXIST: raise |
| 47 for name in names: | 49 for name in names: |
