Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2019-06-18 12:57:07 +0300
committerGhostkeeper <rubend@tutanota.com>2019-06-18 13:00:23 +0300
commit0498d438343f29d24a05dbae46f4624e9692c9ae (patch)
treebe2f8e501657b2a03679d0e0e4181e4c1231b11f /plugins/CuraProfileReader
parent7fbdccffdbe99fdedb69197d1bb0170eecdc467a (diff)
Run upgrader on imported profiles from >2.1
Oops... It should upgrade the old profiles so that they have the correct version and setting version.
Diffstat (limited to 'plugins/CuraProfileReader')
-rw-r--r--plugins/CuraProfileReader/CuraProfileReader.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py
index 911faf2366..e9fc3e1adb 100644
--- a/plugins/CuraProfileReader/CuraProfileReader.py
+++ b/plugins/CuraProfileReader/CuraProfileReader.py
@@ -35,9 +35,12 @@ class CuraProfileReader(ProfileReader):
for profile_id in archive.namelist():
with archive.open(profile_id) as f:
serialized = f.read()
- profile = self._loadProfile(serialized.decode("utf-8"), profile_id)
- if profile is not None:
- results.append(profile)
+ upgraded_profiles = self._upgradeProfile(serialized.decode("utf-8"), profile_id) #After upgrading it may split into multiple profiles.
+ for upgraded_profile in upgraded_profiles:
+ serialization, new_id = upgraded_profile
+ profile = self._loadProfile(serialization, new_id)
+ if profile is not None:
+ results.append(profile)
return results
except zipfile.BadZipFile: