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
44 lines
1.1 KiB
import logging
|
|
import typing
|
|
|
|
from pydantic import BaseModel, validator
|
|
|
|
LOG = logging.getLogger("acm.config")
|
|
|
|
|
|
class ACMProfileTarget(BaseModel):
|
|
name: str
|
|
version: str
|
|
processors: typing.List[str]
|
|
extensions: typing.List[str]
|
|
output_extension: str
|
|
force_preserve_smaller_input: bool
|
|
command: str
|
|
signature: typing.Optional[str]
|
|
|
|
@validator('signature', always=True)
|
|
def signature_validator(cls, v, values) -> str:
|
|
# TODO calculate the hash for the profile target
|
|
return ""
|
|
|
|
|
|
class ACMProfile(BaseModel):
|
|
name: str
|
|
processors: typing.List[ACMProfileTarget]
|
|
signature: typing.Optional[str]
|
|
|
|
@validator('signature', always=True)
|
|
def hash_signature_validator(cls, v, values) -> str:
|
|
# TODO calculate the hash for the profile
|
|
return ""
|
|
|
|
|
|
class ACMConfig(BaseModel):
|
|
concurrency: int = 0
|
|
profiles: typing.List[ACMProfile]
|
|
signature: typing.Optional[str]
|
|
|
|
@validator('signature', always=True)
|
|
def signature_validator(cls, v, values) -> str:
|
|
# TODO calculate the hash for the config
|
|
return ""
|