INNER CODE UNIT · Python
validate_appcast
RockxyApp/Rockxy · releases/validate_metadata.py:296
def validate_appcast(path: Path) -> list[dict[str, str]]:
try:
root = ET.parse(path).getroot()
except FileNotFoundError:
fail(f"{path} is missing")
except ET.ParseError as error:
fail(f"{path} is not valid XML: {error}")
channel = root.find("channel")
if channel is None:
fail(f"{path} is missing channel")
items = channel.findall("item")
if not items:
fail(f"{path} must contain at least one release item")
releases: list[dict[str, str]] = []
for index, item in enumerate(items):
enclosure = item.find("enclosure")