Files
scud_context_api/scripts/diagnostics/show_tree.py

21 lines
729 B
Python

import os
EXCLUDE_DIRS = {'.git', '__pycache__', 'venv', '.venv', 'output', 'logs', 'extracted_project'}
def print_tree(startpath):
print("=" * 60)
print("📂 ДЕРЕВО АРХИТЕКТУРЫ ПРОЕКТА")
print("=" * 60)
for root, dirs, files in os.walk(startpath):
dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]
level = root.replace(startpath, '').count(os.sep)
indent = ' ' * 4 * (level)
print(f'{indent}📁 {os.path.basename(root)}/')
subindent = ' ' * 4 * (level + 1)
for f in sorted(files):
if not f.endswith('.pyc'):
print(f'{subindent}📄 {f}')
print("=" * 60)
if __name__ == "__main__":
print_tree('.')