XmlMaterialValidator.py 777 B

1234567891011121314151617181920212223242526
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import Any, Dict
  4. ## Makes sure that the required metadata is present for a material.
  5. class XmlMaterialValidator:
  6. ## Makes sure that the required metadata is present for a material.
  7. @classmethod
  8. def validateMaterialMetaData(cls, validation_metadata: Dict[str, Any]):
  9. if validation_metadata.get("GUID") is None:
  10. return "Missing GUID"
  11. if validation_metadata.get("brand") is None:
  12. return "Missing Brand"
  13. if validation_metadata.get("material") is None:
  14. return "Missing Material"
  15. if validation_metadata.get("version") is None:
  16. return "Missing Version"
  17. return None