1import os
2from pathlib import Path
3
4THIS_SCRIPT_PATH: Path = Path(__file__)
5CRATES_DIR: Path = THIS_SCRIPT_PATH.parent.parent / "crates"
6
7zed_1_crate_count: int = 0
8zed_2_crate_count: int = 0
9
10for child in os.listdir(CRATES_DIR):
11 child_path: str = os.path.join(CRATES_DIR, child)
12
13 if not os.path.isdir(child_path):
14 continue
15
16 if child.endswith("2"):
17 zed_2_crate_count += 1
18 else:
19 zed_1_crate_count += 1
20
21print(f"crates ported: {zed_2_crate_count}")
22print(f"crates in total: {zed_1_crate_count}")
23
24percent_complete: float = (zed_2_crate_count / zed_1_crate_count) * 100
25percent_complete_rounded: float = round(percent_complete, 2)
26
27print(f"progress: {percent_complete_rounded}%")