mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Better data handling
CURA-5095 Avoid missing sections/options
This commit is contained in:
parent
5a235a59dd
commit
5fc8b95425
1 changed files with 6 additions and 5 deletions
|
@ -86,17 +86,18 @@ class VersionUpgrade34to35(VersionUpgrade):
|
|||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Need to show the data collection agreement again because the data Cura collects has been changed.
|
||||
if parser.has_option("info", "asked_send_slice_info"):
|
||||
parser.remove_option("info", "asked_send_slice_info")
|
||||
if parser.has_option("info", "send_slice_info"):
|
||||
parser.remove_option("info", "send_slice_info")
|
||||
|
||||
# Update version number.
|
||||
parser["general"]["version"] = "6"
|
||||
if "metadata" not in parser:
|
||||
parser["metadata"] = {}
|
||||
parser["metadata"]["setting_version"] = "5"
|
||||
|
||||
# Need to show the data collection agreement again because the data Cura collects has been changed.
|
||||
if parser.has_option("info", "asked_send_slice_info"):
|
||||
parser.remove_option("info", "asked_send_slice_info")
|
||||
parser.remove_option("info", "send_slice_info")
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue