mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 19:39:03 +08:00
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.
This commit is contained in:
parent
7fbdccffdb
commit
0498d43834
@ -35,9 +35,12 @@ class CuraProfileReader(ProfileReader):
|
|||||||
for profile_id in archive.namelist():
|
for profile_id in archive.namelist():
|
||||||
with archive.open(profile_id) as f:
|
with archive.open(profile_id) as f:
|
||||||
serialized = f.read()
|
serialized = f.read()
|
||||||
profile = self._loadProfile(serialized.decode("utf-8"), profile_id)
|
upgraded_profiles = self._upgradeProfile(serialized.decode("utf-8"), profile_id) #After upgrading it may split into multiple profiles.
|
||||||
if profile is not None:
|
for upgraded_profile in upgraded_profiles:
|
||||||
results.append(profile)
|
serialization, new_id = upgraded_profile
|
||||||
|
profile = self._loadProfile(serialization, new_id)
|
||||||
|
if profile is not None:
|
||||||
|
results.append(profile)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
except zipfile.BadZipFile:
|
except zipfile.BadZipFile:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user