More sensible sorting of baudrates for auto detect

115200 is the most likely baudrate candidate for printers, followed
by 250000. Any additional baudrates that were configured are even more
likely.
This commit is contained in:
Gina Häußge committed 2017-05-24 17:56:01 +02:00
1 parent 78724163b1
commit dffb33727d
2 files changed
+15 -12

No files matched your search

+2 -2
View File
@@ -78,8 +78,8 @@ def _get_options():
default_profile = printerProfileManager.get_default()
options = dict(
ports=connection_options["ports"],
baudrates=connection_options["baudrates"],
ports=sorted(connection_options["ports"]),
baudrates=sorted(connection_options["baudrates"], reverse=True),
printerProfiles=[dict(id=printer_profile["id"], name=printer_profile["name"] if "name" in printer_profile else printer_profile["id"]) for printer_profile in profile_options.values() if "id" in printer_profile],
portPreference=connection_options["portPreference"],
baudratePreference=connection_options["baudratePreference"],