diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-12-03 15:25:41 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-12-03 15:25:41 +0300 |
commit | 0477ba44b2fb8e154c9fda145ae36245a4c31d40 (patch) | |
tree | 930742ca96acbc63d5781d546450dc5fb89e9fa2 | |
parent | b76df21b4b0f8ed734369317e31cd70a4bc73785 (diff) |
Encode capabilities as comma-separated list
Previously it was encoded as a stringified Python list of strings, which is much harder to parse.
This would go wrong if any of these capabilities have a comma in them, but I think that would be bad practice for keywords like this anyway.
Contributes to issue CURA-8671.
-rw-r--r-- | cura/Machines/Models/GlobalStacksModel.py | 2 | ||||
-rw-r--r-- | plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/cura/Machines/Models/GlobalStacksModel.py b/cura/Machines/Models/GlobalStacksModel.py index cc750f2244..e0dd298b98 100644 --- a/cura/Machines/Models/GlobalStacksModel.py +++ b/cura/Machines/Models/GlobalStacksModel.py @@ -123,7 +123,7 @@ class GlobalStacksModel(ListModel): if self._filter_online_only and not is_online: continue - capabilities = set(container_stack.getMetaDataEntry(META_CAPABILITIES, set())) + capabilities = set(container_stack.getMetaDataEntry(META_CAPABILITIES, "").split(",")) if set(self._filter_capabilities) - capabilities: # Not all required capabilities are met. continue diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index 862c583f79..8eecafd49c 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -129,7 +129,7 @@ class CloudOutputDeviceManager: if not parseBool(self._um_cloud_printers[device_id].getMetaDataEntry(META_UM_LINKED_TO_ACCOUNT, "true")): self._um_cloud_printers[device_id].setMetaDataEntry(META_UM_LINKED_TO_ACCOUNT, True) if not self._um_cloud_printers[device_id].getMetaDataEntry(META_CAPABILITIES, None): - self._um_cloud_printers[device_id].setMetaDataEntry(META_CAPABILITIES, cluster_data.capabilities) + self._um_cloud_printers[device_id].setMetaDataEntry(META_CAPABILITIES, ",".join(cluster_data.capabilities)) self._onDevicesDiscovered(new_clusters) self._updateOnlinePrinters(all_clusters) |