mirror of
https://github.com/rommapp/romm.git
synced 2026-06-27 22:35:57 +00:00
Standardize backend/tools file headers
Give all three tools the same header shape: shebang, summary docstring, a short detail paragraph, and a "Run from the backend directory:" command block. Adds docstrings to generate_supported_platforms.py and xml_diagnostics.py, which previously had none. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
# uv run python -m tools.generate_supported_platforms
|
||||
#!/usr/bin/env python3
|
||||
"""Print the supported-platforms table (Markdown) for the docs.
|
||||
|
||||
Walks every UniversalPlatformSlug, collects each metadata provider's
|
||||
platform mapping, and emits a Markdown table (with provider link icons) to
|
||||
stdout for pasting into the documentation.
|
||||
|
||||
Run from the backend directory:
|
||||
|
||||
uv run python -m tools.generate_supported_platforms
|
||||
"""
|
||||
|
||||
from typing import TypedDict
|
||||
from urllib.parse import quote
|
||||
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Diagnose a malformed XML file: bad encoding, invalid chars, parse errors.
|
||||
|
||||
Reads the file in chunks to surface UTF-8 issues, then runs SAX and
|
||||
ElementTree parsing to report the location of structural errors, with a few
|
||||
lines of context around each one.
|
||||
|
||||
Run from the backend directory:
|
||||
|
||||
uv run tools/xml_diagnostics.py <xml_file>
|
||||
"""
|
||||
|
||||
import sys
|
||||
from xml.sax.handler import ContentHandler # nosec
|
||||
|
||||
@@ -79,6 +91,6 @@ def diagnose_xml(filename):
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python script.py <xml_file>")
|
||||
print("Usage: uv run tools/xml_diagnostics.py <xml_file>")
|
||||
sys.exit(1)
|
||||
diagnose_xml(sys.argv[1])
|
||||
|
||||
Reference in New Issue
Block a user