53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Simple debug script to check directory structure
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
|
|
def check_script_groups():
|
|
"""Check script groups directory structure"""
|
|
print("=== Checking Script Groups Directory ===")
|
|
|
|
backend_path = Path("app/backend/script_groups")
|
|
print(f"Backend path: {backend_path.absolute()}")
|
|
print(f"Exists: {backend_path.exists()}")
|
|
|
|
if not backend_path.exists():
|
|
print("Backend path does not exist!")
|
|
return
|
|
|
|
print("\nDirectories found:")
|
|
for item in backend_path.iterdir():
|
|
if item.is_dir():
|
|
print(f"\n--- {item.name} ---")
|
|
|
|
# Check metadata.json
|
|
metadata_file = item / "metadata.json"
|
|
print(
|
|
f" metadata.json: {'EXISTS' if metadata_file.exists() else 'MISSING'}"
|
|
)
|
|
|
|
# Check Python files
|
|
python_files = list(item.glob("*.py"))
|
|
print(f" Python files: {len(python_files)}")
|
|
for py_file in python_files:
|
|
print(f" - {py_file.name}")
|
|
|
|
# Check if file has header metadata
|
|
try:
|
|
with open(py_file, "r", encoding="utf-8") as f:
|
|
first_lines = f.read(500) # Read first 500 chars
|
|
if "ScriptsManager Metadata:" in first_lines:
|
|
print(f" ✓ Has ScriptsManager metadata")
|
|
else:
|
|
print(f" ✗ Missing ScriptsManager metadata")
|
|
except Exception as e:
|
|
print(f" ✗ Error reading file: {e}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
check_script_groups()
|