Fix loading .curaproject files with stack setups from earlier versions - CURA-4646

This commit is contained in:
ChrisTerBeke 2017-11-30 15:24:51 +01:00
parent b425672ad0
commit 3abf067d25
3 changed files with 58 additions and 37 deletions

View file

@ -203,6 +203,14 @@ class VersionUpgrade30to31(VersionUpgrade):
def _createExtruderQualityChangesForSingleExtrusionMachine(self, filename, global_quality_changes):
suffix = "_" + quote_plus(global_quality_changes["general"]["name"].lower())
machine_name = os.path.os.path.basename(filename).replace(".inst.cfg", "").replace(suffix, "")
# Why is this here?!
# When we load a .curaprofile file the deserialize will trigger a version upgrade, creating a dangling file.
# This file can be recognized by it's lack of a machine name in the target filename.
# So when we detect that situation here, we don't create the file and return.
if machine_name == "":
return
new_filename = machine_name + "_" + "fdmextruder" + suffix
extruder_quality_changes_parser = configparser.ConfigParser()