Update py2so.py
Showing
1 changed file
with
7 additions
and
5 deletions
... | @@ -59,14 +59,16 @@ def copy_other_files(input_path, exclude_paths, output_path): | ... | @@ -59,14 +59,16 @@ def copy_other_files(input_path, exclude_paths, output_path): |
59 | return | 59 | return |
60 | for parent, _, filenames in os.walk(input_path): | 60 | for parent, _, filenames in os.walk(input_path): |
61 | if parent in exclude_paths: | 61 | if parent in exclude_paths: |
62 | relpath = os.path.relpath(parent, input_path) | 62 | # relpath = os.path.relpath(parent, input_path) |
63 | target_dir = os.path.join(output_path, relpath) | 63 | # target_dir = os.path.join(output_path, relpath) |
64 | shutil.copytree(parent, target_dir) | 64 | # shutil.copytree(parent, target_dir) |
65 | print('copy {0} to {1}'.format(parent, target_dir)) | 65 | # print('copy {0} to {1}'.format(parent, target_dir)) |
66 | continue | 66 | continue |
67 | for filename in filenames: | 67 | for filename in filenames: |
68 | file_path = os.path.join(parent, filename) | 68 | file_path = os.path.join(parent, filename) |
69 | if file_path in exclude_paths or not is_about_py(filename): | 69 | if file_path in exclude_paths: |
70 | continue | ||
71 | elif not is_about_py(filename): | ||
70 | relpath = os.path.relpath(file_path, input_path) | 72 | relpath = os.path.relpath(file_path, input_path) |
71 | target_path = os.path.join(output_path, relpath) | 73 | target_path = os.path.join(output_path, relpath) |
72 | os.makedirs(os.path.dirname(target_path), exist_ok=True) | 74 | os.makedirs(os.path.dirname(target_path), exist_ok=True) | ... | ... |
-
Please register or sign in to post a comment