Apply suggestions from code review

Co-authored-by: Konstantinos Karmas <konskarm@gmail.com>
This commit is contained in:
Alexander Gee 2020-07-08 00:30:19 -05:00 committed by GitHub
parent 18098ae893
commit 0a97511d3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 14 deletions

View file

@ -122,14 +122,14 @@ class VersionUpgrade462to47(VersionUpgrade):
del script_parser["PauseAtHeight"]["redo_layers"] # Has been renamed to without the S.
# Migrate DisplayCompleteOnLCD to DisplayProgressOnLCD
if script_id == "DisplayPercentCompleteOnLCD":
was_enabled = script_parser[script_id]["TurnOn"] == "true" if "TurnOn" in script_parser[script_id] else False
if script_id == "DisplayRemainingTimeOnLCD":
was_enabled = parseBool(script_parser[script_id]["TurnOn"]) if "TurnOn" in script_parser[script_id] else False
script_parser.remove_section(script_id)
script_id = "DisplayProgressOnLCD"
script_parser.add_section(script_id)
if (was_enabled):
script_parser.set(script_id, "time_remaining", "true")
if was_enabled:
script_parser.set(script_id, "time_remaining", "True")
script_io = io.StringIO()
script_parser.write(script_io)