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):
return
for parent, _, filenames in os.walk(input_path):
if parent in exclude_paths:
relpath = os.path.relpath(parent, input_path)
target_dir = os.path.join(output_path, relpath)
shutil.copytree(parent, target_dir)
print('copy {0} to {1}'.format(parent, target_dir))
# relpath = os.path.relpath(parent, input_path)
# target_dir = os.path.join(output_path, relpath)
# shutil.copytree(parent, target_dir)
# print('copy {0} to {1}'.format(parent, target_dir))
continue
for filename in filenames:
file_path = os.path.join(parent, filename)
if file_path in exclude_paths or not is_about_py(filename):
if file_path in exclude_paths:
continue
elif not is_about_py(filename):
relpath = os.path.relpath(file_path, input_path)
target_path = os.path.join(output_path, relpath)
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!