This repository has been archived on 2026-08-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ROCm-Research-Archive/Scripts and Tests/_check_routes.py
T
2026-08-20 00:45:43 +02:00

17 lines
551 B
Python

#!/usr/bin/env python3
"""Check registered Flask routes in dashboard"""
import sys
sys.path.insert(0, "/opt/dashboard")
# Read the app.py source and exec it, but stop before app.run
src = open("/opt/dashboard/app.py").read()
# Find app.run and cut before it
idx = src.find("app.run(")
if idx > 0:
exec(compile(src[:idx], "app.py", "exec"))
else:
exec(compile(src, "app.py", "exec"))
for rule in sorted(app.url_map.iter_rules(), key=lambda r: str(r)):
if "tts" in str(rule) or "proxy" in str(rule):
print(f"{rule.methods} {rule}")