(paths)
| 62 | |
| 63 | |
| 64 | def build_tree(paths): |
| 65 | tree = {} |
| 66 | current_working_directory = os.getcwd() |
| 67 | current_folder_name = os.path.basename(current_working_directory) |
| 68 | # Filter out invalid and non-existent paths |
| 69 | relative_dirs = [] |
| 70 | for path in paths: |
| 71 | normalized_path = os.path.normpath(path) |
| 72 | try: |
| 73 | rel_path = os.path.relpath(normalized_path, start=current_working_directory) |
| 74 | add_path_to_tree(tree, normalized_path) |
| 75 | except ValueError: |
| 76 | print(f"Remove unexcpect dir:{path}") |
| 77 | |
| 78 | return tree |
| 79 | |
| 80 | def print_tree(tree, indent=''): |
| 81 | for key, subtree in sorted(tree.items()): |
no test coverage detected