Fix setting the time_remaining_method in the versionUpgrader

The DisplayProgressOnLCD script was changed and the "time_remaining" was split into two settings:
the "time_remaining" and the "time_remaining_method". If the "time_remaining" was enabled, the
"time_remaining_method" should be set to "m117".

The VersionUpgrader48to49 was changing the "time_remaining" to "m117" instead of changing the
"time_remaining_method", which was leading to the "time_remaining" having a wrong value and not
being interpreted as a boolean.

This commit fixes that by setting the "time_remaining_method" into "m117" when the "time_remaining"
was True.

CURA-8110
This commit is contained in:
Kostas Karmas 2021-04-06 11:38:28 +02:00
parent 27fc435724
commit 081b0b23a4

View File

@ -68,7 +68,7 @@ class VersionUpgrade48to49(VersionUpgrade):
# Update Display Progress on LCD parameters.
script_id = script_parser.sections()[0]
if script_id == "DisplayProgressOnLCD":
script_parser[script_id]["time_remaining"] = "m117" if script_parser[script_id]["time_remaining"] == "True" else "none"
script_parser[script_id]["time_remaining_method"] = "m117" if script_parser[script_id]["time_remaining"] == "True" else "none"
script_io = io.StringIO()
script_parser.write(script_io)