diff options
author | alekseisasin <a.sasin@ultimaker.com> | 2018-01-31 17:00:46 +0300 |
---|---|---|
committer | alekseisasin <a.sasin@ultimaker.com> | 2018-01-31 17:00:46 +0300 |
commit | a446ca2759170b78bb17d14fdc15c9d5c9e00010 (patch) | |
tree | ecfc17749f5f165cf016b0dbe2566f54c3925f38 /plugins/XmlMaterialProfile/XmlMaterialValidator.py | |
parent | e5c72cfdc5cef3d1cb995d5e9504e45fb94216c6 (diff) |
Material container validation
CURA-4851
Diffstat (limited to 'plugins/XmlMaterialProfile/XmlMaterialValidator.py')
-rw-r--r-- | plugins/XmlMaterialProfile/XmlMaterialValidator.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/XmlMaterialProfile/XmlMaterialValidator.py b/plugins/XmlMaterialProfile/XmlMaterialValidator.py new file mode 100644 index 0000000000..42fd505e2d --- /dev/null +++ b/plugins/XmlMaterialProfile/XmlMaterialValidator.py @@ -0,0 +1,31 @@ +# Copyright (c) 2017 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. + + + +class XmlMaterialValidater(): + + @classmethod + def validateMaterialMetaDate(cls, validation_metadata): + + if validation_metadata.get("GUID") is None: + return "Missing GUID" + + if validation_metadata.get("brand") is None: + return "Missing Brand" + + if validation_metadata.get("material") is None: + return "Missing Material" + + if validation_metadata.get("version") is None: + return "Missing Version" + + if validation_metadata.get("description") is None: + return "Missing Description" + + if validation_metadata.get("adhesion_info") is None: + return "Missing Adhesion Info" + + return None + + |