Add some more information for the unhappy route and a message to inform the user.

CURA-6990
This commit is contained in:
j.delarago 2022-05-31 16:29:56 +02:00
parent 094c781b02
commit 29b6450704
2 changed files with 12 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import os
from typing import Any, cast, Dict, List, Set, Tuple, TYPE_CHECKING, Optional
from UM.Logger import Logger
from cura.CuraApplication import CuraApplication # To find some resource types.
from cura.Settings.GlobalStack import GlobalStack
@ -70,9 +71,9 @@ class CuraPackageManager(PackageManager):
parsed_guid = XmlMaterialProfile.getMetadataFromSerialized(f.read(), "GUID")
if guid == parsed_guid:
return package_id
continue
Logger.error("Could not find package_id for file: {} with GUID: {} ".format(file_name, guid))
return ""
def getMachinesUsingPackage(self, package_id: str) -> Tuple[List[Tuple[GlobalStack, str, str]], List[Tuple[GlobalStack, str, str]]]:
"""Returns a list of where the package is used