MCPcopy Create free account
hub / github.com/FastLED/FastLED / parse_from_url

Method parse_from_url

ci/compiler/packages.py:453–467  ·  view source on GitHub ↗

Fetch and parse package index from URL with validation

(self, url: str)

Source from the content-addressed store, hash-verified

451 raise PackageParsingError(f"Invalid JSON format: {e}")
452
453 def parse_from_url(self, url: str) -> PackageIndex:
454 """Fetch and parse package index from URL with validation"""
455 try:
456 print(f"Fetching package index from: {url}")
457 with urlopen(url, timeout=self.timeout) as response:
458 content = response.read()
459 json_str = content.decode("utf-8")
460
461 return self.parse_package_index(json_str)
462
463 except KeyboardInterrupt as ki:
464 handle_keyboard_interrupt(ki)
465 raise
466 except Exception as e:
467 raise PackageParsingError(f"Error fetching package index from {url}: {e}")
468
469 async def parse_from_url_async(self, url: str) -> PackageIndex:
470 """Async version of URL parsing"""

Callers 2

demo_esp32_parsingFunction · 0.95

Calls 6

parse_package_indexMethod · 0.95
PackageParsingErrorClass · 0.85
printFunction · 0.50
readMethod · 0.45
decodeMethod · 0.45

Tested by 1