(root: str)
| 76 | |
| 77 | |
| 78 | def naive_source_size(root: str) -> int: |
| 79 | total = 0 |
| 80 | for dirpath, _dirs, files in os.walk(root): |
| 81 | for f in files: |
| 82 | if f.endswith(".py"): |
| 83 | try: |
| 84 | total += os.path.getsize(os.path.join(dirpath, f)) |
| 85 | except OSError: |
| 86 | pass |
| 87 | return total |
| 88 | |
| 89 | |
| 90 | # --------------------------------------------------------------------------- |