mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Added logging for cases where the upgrade of the profile failed
CURA-6592
This commit is contained in:
parent
6273d34eae
commit
0a0b4821ef
1 changed files with 3 additions and 1 deletions
|
@ -32,7 +32,7 @@ class CuraProfileReader(ProfileReader):
|
||||||
def read(self, file_name: str) -> List[Optional[InstanceContainer]]:
|
def read(self, file_name: str) -> List[Optional[InstanceContainer]]:
|
||||||
try:
|
try:
|
||||||
with zipfile.ZipFile(file_name, "r") as archive:
|
with zipfile.ZipFile(file_name, "r") as archive:
|
||||||
results = [] #type: List[Optional[InstanceContainer]]
|
results = [] # type: List[Optional[InstanceContainer]]
|
||||||
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()
|
||||||
|
@ -107,9 +107,11 @@ class CuraProfileReader(ProfileReader):
|
||||||
if source_format in plugin["version_upgrade"] and plugin["version_upgrade"][source_format][1] == InstanceContainer.Version]
|
if source_format in plugin["version_upgrade"] and plugin["version_upgrade"][source_format][1] == InstanceContainer.Version]
|
||||||
|
|
||||||
if not profile_convert_funcs:
|
if not profile_convert_funcs:
|
||||||
|
Logger.log("w", "Unable to find an upgrade path for the profile [%s]", profile_id)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
filenames, outputs = profile_convert_funcs[0](serialized, profile_id)
|
filenames, outputs = profile_convert_funcs[0](serialized, profile_id)
|
||||||
if filenames is None and outputs is None:
|
if filenames is None and outputs is None:
|
||||||
|
Logger.log("w", "The conversion failed to return any usable data for [%s]", profile_id)
|
||||||
return []
|
return []
|
||||||
return list(zip(outputs, filenames))
|
return list(zip(outputs, filenames))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue