diff options
author | Jelle Spijker <j.spijker@ultimaker.com> | 2022-06-16 11:48:41 +0300 |
---|---|---|
committer | Jelle Spijker <j.spijker@ultimaker.com> | 2022-06-16 11:48:41 +0300 |
commit | b8a4243e26dc9801ac252395273fbaea7e209950 (patch) | |
tree | f586099977956389dd24c7480ea01e2329bb6160 /cura/CuraPackageManager.py | |
parent | d9b9959346d8e8098d20926900bca6b89233c1da (diff) | |
parent | ac32f3b62553de8a5acf75e1d45cbe54de846be3 (diff) |
Merge branch 'main' into CURA-9365_fix_building_cura_main
Diffstat (limited to 'cura/CuraPackageManager.py')
-rw-r--r-- | cura/CuraPackageManager.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 2cb29a0614..be8777972a 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -62,10 +62,11 @@ class CuraPackageManager(PackageManager): 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')] + paths = [Path(p) for p in glob.glob(path + '/**/*.xml.fdm_material', recursive=True)] for material in paths: if material.name == file_name: - with open(str(material), encoding="utf-8") as f: + Logger.info(f"Found bundled material: {material.name}. Located in path: {str(material)}") + with open(material, 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( @@ -87,11 +88,12 @@ 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( f.read(), "GUID") + if guid == parsed_guid: return package_id |