Show validation results in sorted order

CURA-3710
This commit is contained in:
Lipu Fei 2018-02-01 11:17:16 +01:00
parent 0e5c67a38f
commit 0fbc56a025

View file

@ -67,9 +67,11 @@ class PresetSettingsValidator:
print("[INVALID] [%s] is invalid, details below" % file_path) print("[INVALID] [%s] is invalid, details below" % file_path)
# show details # show details
for section_name in incorrect_sections: for section_name in sorted(incorrect_sections):
print(" -- section name [%s] is incorrect, please check fdmprinter.def.json." % section_name) print(" -- section name [%s] is incorrect, please check fdmprinter.def.json." % section_name)
for setting_name, details_dict in incorrect_settings.items():
for setting_name in sorted(incorrect_settings.keys()):
details_dict = incorrect_settings[setting_name]
msg = " -- setting [%s] is found in sections [%s], " % (setting_name, ", ".join(details_dict["seen_in"])) msg = " -- setting [%s] is found in sections [%s], " % (setting_name, ", ".join(details_dict["seen_in"]))
if details_dict["should_be_in"] is not None: if details_dict["should_be_in"] is not None:
msg += "but should be in section [%s] only." % details_dict["should_be_in"] msg += "but should be in section [%s] only." % details_dict["should_be_in"]