copytree a directory Args: src: source directory dst: destination directory symlinks: copy symlinks ignore: ignore Returns: True
(src, dst, symlinks=True, ignore=None)
| 156 | |
| 157 | |
| 158 | def copy_dir_tree(src, dst, symlinks=True, ignore=None): |
| 159 | """ |
| 160 | copytree a directory |
| 161 | |
| 162 | Args: |
| 163 | src: source directory |
| 164 | dst: destination directory |
| 165 | symlinks: copy symlinks |
| 166 | ignore: ignore |
| 167 | |
| 168 | Returns: |
| 169 | True |
| 170 | """ |
| 171 | # https://stackoverflow.com/a/12514470 |
| 172 | for item in os.listdir(src): |
| 173 | s = os.path.join(src, item) |
| 174 | d = os.path.join(dst, item) |
| 175 | if os.path.isdir(s): |
| 176 | shutil.copytree(s, d, symlinks, ignore) |
| 177 | else: |
| 178 | shutil.copy2(s, d) |
| 179 | return True |
| 180 | |
| 181 | |
| 182 | def get_module_dir_path(module): |