diff options
author | Nino van Hooff <ninovanhooff@gmail.com> | 2020-05-19 16:51:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 16:51:21 +0300 |
commit | 81ec7d6582bd24afe929600c4b431e9f03bcd06a (patch) | |
tree | 4953b02ccd696e024d81c304c59395539c4d0a3f /plugins/VersionUpgrade | |
parent | 98fed9572517ed1f871f6980579a49a1018af637 (diff) | |
parent | 321693d41023941f8fc5889ff42fbffbe0cb3fed (diff) |
Merge pull request #7201 from fieldOfView/feature_unify_pause_at_height
Unify pause at height scripts
Diffstat (limited to 'plugins/VersionUpgrade')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py index 9a70963e6b..7b328e10e6 100644 --- a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py +++ b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py @@ -97,6 +97,25 @@ class VersionUpgrade462to47(VersionUpgrade): script_parser = configparser.ConfigParser(interpolation=None) script_parser.optionxform = str # type: ignore # Don't transform the setting keys as they are case-sensitive. script_parser.read_string(script_str) + + # Unify all Pause at Height + script_id = script_parser.sections()[0] + if script_id in ["BQ_PauseAtHeight", "PauseAtHeightRepRapFirmwareDuet", "PauseAtHeightforRepetier"]: + script_settings = script_parser.items(script_id) + script_settings.append(("pause_method", { + "BQ_PauseAtHeight": "bq", + "PauseAtHeightforRepetier": "repetier", + "PauseAtHeightRepRapFirmwareDuet": "reprap" + }[script_id])) + + # Since we cannot rename a section, we remove the original section and create a new section with the new script id. + script_parser.remove_section(script_id) + script_id = "PauseAtHeight" + script_parser.add_section(script_id) + for setting_tuple in script_settings: + script_parser.set(script_id, setting_tuple[0], setting_tuple[1]) + + # Update redo_layers to redo_layer if "PauseAtHeight" in script_parser: if "redo_layers" in script_parser["PauseAtHeight"]: script_parser["PauseAtHeight"]["redo_layer"] = str(int(script_parser["PauseAtHeight"]["redo_layers"]) > 0) |