Make printer name sorting case insensitive again.

part of CURA-7493
This commit is contained in:
Remco Burema 2020-06-09 17:28:02 +02:00
parent b734830fcf
commit 29442e29e4
No known key found for this signature in database
GPG key ID: 215C49431D43F98C

View file

@ -163,11 +163,11 @@ class CloudOutputDeviceManager:
self._connectToActiveMachine()
return
# Sort new_devices on online status first, alphabetical (case-sensitive) second.
# Sort new_devices on online status first, alphabetical second.
# Since the first device might be activated in case there is no active printer yet,
# it would be nice to prioritize online devices
online_cluster_names = {c.friendly_name for c in clusters if c.is_online}
new_devices.sort(key = lambda x: "a{}".format(x.name) if x.name in online_cluster_names else "b{}".format(x.name))
online_cluster_names = {c.friendly_name.lower() for c in clusters if c.is_online}
new_devices.sort(key = lambda x: ("a{}" if x.name.lower() in online_cluster_names else "b{}").format(x.name.lower()))
image_path = os.path.join(
CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting") or "",