INNER CODE UNIT · Python
find_text
RockxyApp/Rockxy · releases/validate_metadata.py:291
def find_text(parent: ET.Element, path: str) -> str:
found = parent.find(path, {"sparkle": SPARKLE_NS, "rockxy": ROCKXY_NS})
return (found.text or "").strip() if found is not None else ""
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: