97b2d3ed by 周伟奇

Update py2so.py

1 parent ae1b0bc8
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)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!