Tooling for managing asset compression, storage, and retrieval
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. import logging
  2. import typing
  3. from pydantic import BaseModel, validator
  4. LOG = logging.getLogger("acm.config")
  5. class ACMProfileTarget(BaseModel):
  6. name: str
  7. version: str
  8. processors: typing.List[str]
  9. extensions: typing.List[str]
  10. output_extension: str
  11. force_preserve_smaller_input: bool
  12. command: str
  13. signature: typing.Optional[str]
  14. @validator('signature', always=True)
  15. def signature_validator(cls, v, values) -> str:
  16. # TODO calculate the hash for the profile target
  17. return ""
  18. class ACMProfile(BaseModel):
  19. name: str
  20. processors: typing.List[ACMProfileTarget]
  21. signature: typing.Optional[str]
  22. @validator('signature', always=True)
  23. def hash_signature_validator(cls, v, values) -> str:
  24. # TODO calculate the hash for the profile
  25. return ""
  26. class ACMConfig(BaseModel):
  27. concurrency: int = 0
  28. profiles: typing.List[ACMProfile]
  29. signature: typing.Optional[str]
  30. @validator('signature', always=True)
  31. def signature_validator(cls, v, values) -> str:
  32. # TODO calculate the hash for the config
  33. return ""