File size: 724 Bytes
f4fdd14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | from pathlib import Path
import re, xml.etree.ElementTree as ET
root = Path(__file__).resolve().parent
errors = []
for p in root.rglob("*.usda"):
for ref in re.findall(r"@([^@]+)@", p.read_text()):
if not ref.startswith(("http:", "https:", "omniverse:")) and not (p.parent / ref).exists():
errors.append((str(p.relative_to(root)), ref))
for p in (root / "assets/libero_runtime").rglob("*.xml"):
for element in ET.parse(p).iter():
ref = element.get("file")
if ref and not (p.parent / ref).is_file(): errors.append((str(p.relative_to(root)), ref))
if errors:
raise SystemExit("Missing dependencies: " + repr(errors[:20]))
print("PASS: all local USDA/XML file references exist")
|