diff options
author | j.delarago <joeydelarago@gmail.com> | 2022-06-15 12:55:53 +0300 |
---|---|---|
committer | j.delarago <joeydelarago@gmail.com> | 2022-06-15 12:55:53 +0300 |
commit | febb7f1205451546ad543505d2104bd5fdb0d92e (patch) | |
tree | d0ea1ead2e6194dd7d5d30b63520e8bfc21035b0 /cura | |
parent | 90bb02acaea4a12307488c6e29760b580e95996b (diff) |
temu extra logging for debugging
Diffstat (limited to 'cura')
-rw-r--r-- | cura/CuraPackageManager.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 87a2935d96..ef36e5c777 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -59,10 +59,12 @@ class CuraPackageManager(PackageManager): def isMaterialBundled(self, file_name: str, guid: str): """ Check if there is a bundled material name with file_name and guid """ + Logger.error(f"Paths: {list(Resources.getSecureSearchPaths())}") for path in Resources.getSecureSearchPaths(): # Secure search paths are install directory paths, if a material is in here it must be bundled. paths = [Path(p) for p in glob.glob(path + '/**/*.xml.fdm_material')] + Logger.error(f"Paths: {[(material.name, str(material)) for material in paths]}") for material in paths: if material.name == file_name: with open(str(material), encoding="utf-8") as f: @@ -73,12 +75,14 @@ class CuraPackageManager(PackageManager): f.read(), "GUID") if guid == parsed_guid: # The material we found matches both filename and GUID + Logger.error("MATERIAL IS BUNDLED") return True return False def getMaterialFilePackageId(self, file_name: str, guid: str) -> str: """Get the id of the installed material package that contains file_name""" + Logger.error(f'Material package search paths {[f for f in os.scandir(self._installation_dirs_dict["materials"]) if f.is_dir()]}') for material_package in [f for f in os.scandir(self._installation_dirs_dict["materials"]) if f.is_dir()]: package_id = material_package.name @@ -87,7 +91,7 @@ class CuraPackageManager(PackageManager): # File with the name we are looking for is not in this directory continue - with open(root + "/" + file_name, encoding="utf-8") as f: + with open(os.path.join(root, file_name), encoding="utf-8") as f: # Make sure the file we found has the same guid as our material # Parsing this xml would be better but the namespace is needed to search it. parsed_guid = PluginRegistry.getInstance().getPluginObject("XmlMaterialProfile").getMetadataFromSerialized( |