mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
CURA-5175 Add variants to the version upgrade.
Upgrade the version number in the variants and add the hardware_type metadata.
This commit is contained in:
parent
b3d652839d
commit
a5e38bb486
3 changed files with 28 additions and 1 deletions
|
@ -149,6 +149,22 @@ class VersionUpgrade32to33(VersionUpgrade):
|
|||
#Update version number.
|
||||
parser["general"]["version"] = "3"
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
||||
|
||||
## Upgrades a variant container to the new format.
|
||||
def upgradeVariants(self, serialized, filename):
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
#Add the hardware type to the variants
|
||||
if "metadata" in parser and "hardware_type" not in parser["metadata"]:
|
||||
parser["metadata"]["hardware_type"] = "nozzle"
|
||||
|
||||
#Update version number.
|
||||
parser["general"]["version"] = "3"
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
Loading…
Add table
Add a link
Reference in a new issue