mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
STAR-322: Extracting models to be able for converting themselves
This commit is contained in:
parent
163226f940
commit
b693b9d98f
20 changed files with 324 additions and 254 deletions
|
@ -8,6 +8,7 @@ class BaseModel:
|
|||
self.__dict__.update(kwargs)
|
||||
self.validate()
|
||||
|
||||
# Validates the model, raising an exception if the model is invalid.
|
||||
def validate(self) -> None:
|
||||
pass
|
||||
|
||||
|
@ -34,7 +35,9 @@ class LocalMaterial(BaseModel):
|
|||
self.version = version # type: int
|
||||
super().__init__(**kwargs)
|
||||
|
||||
#
|
||||
def validate(self) -> None:
|
||||
super().validate()
|
||||
if not self.GUID:
|
||||
raise ValueError("guid is required on LocalMaterial")
|
||||
if not self.version:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue