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

Function validate_request

ci/util/pio_package_daemon.py:361–388  ·  view source on GitHub ↗

Validate package installation request. Args: request: PackageRequest object Returns: True if request is valid, False otherwise

(request: PackageRequest)

Source from the content-addressed store, hash-verified

359
360
361def validate_request(request: PackageRequest) -> bool:
362 """Validate package installation request.
363
364 Args:
365 request: PackageRequest object
366
367 Returns:
368 True if request is valid, False otherwise
369 """
370 project_dir = Path(request.project_dir)
371
372 # Verify project directory exists
373 if not project_dir.exists() or not project_dir.is_dir():
374 logging.error(f"Project directory does not exist: {project_dir}")
375 return False
376
377 # Verify platformio.ini exists
378 if not (project_dir / "platformio.ini").exists():
379 logging.error(f"platformio.ini not found in {project_dir}")
380 return False
381
382 # Verify environment is valid (if provided)
383 env = request.environment
384 if env is not None and (not isinstance(env, str) or not env):
385 logging.error(f"Invalid environment: {env}")
386 return False
387
388 return True
389
390
391def run_package_install_with_retry(

Callers 1

run_daemon_loopFunction · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected