mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Add debuging repr to print more nicely
Otherwise you just see <CloudClusterResponse object> when you try to print this. Contributes to issue CURA-8671.
This commit is contained in:
parent
0477ba44b2
commit
6d9142579a
1 changed files with 7 additions and 0 deletions
|
@ -45,3 +45,10 @@ class CloudClusterResponse(BaseModel):
|
|||
super().validate()
|
||||
if not self.cluster_id:
|
||||
raise ValueError("cluster_id is required on CloudCluster")
|
||||
|
||||
def __repr__(self) -> str:
|
||||
"""
|
||||
Convenience function for printing when debugging.
|
||||
:return: A human-readable representation of the data in this object.
|
||||
"""
|
||||
return str({k: v for k, v in self.__dict__.items() if k in {"cluster_id", "host_guid", "host_name", "status", "is_online", "host_version", "host_internal_ip", "friendly_name", "printer_type", "printer_count", "capabilities"}})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue