LocalMaterial.py 729 B

123456789101112131415161718192021
  1. # Copyright (c) 2019 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from .BaseModel import BaseModel
  4. class LocalMaterial(BaseModel):
  5. def __init__(self, GUID: str, id: str, version: int, **kwargs) -> None:
  6. self.GUID = GUID # type: str
  7. self.id = id # type: str
  8. self.version = version # type: int
  9. super().__init__(**kwargs)
  10. def validate(self) -> None:
  11. super().validate()
  12. if not self.GUID:
  13. raise ValueError("guid is required on LocalMaterial")
  14. if not self.version:
  15. raise ValueError("version is required on LocalMaterial")
  16. if not self.id:
  17. raise ValueError("id is required on LocalMaterial")