ifc.resolve_uri - remove redundant second check

os.path.isabs(uri) is already checked at the beginning of the function
This commit is contained in:
Andrej730
2024-09-02 16:33:16 +05:00
parent 151244ae79
commit d77f57c68e
+2 -2
View File
@@ -196,13 +196,13 @@ class Ifc(bonsai.core.tool.Ifc):
IfcStore.edited_objs.discard(obj)
@classmethod
def resolve_uri(cls, uri):
def resolve_uri(cls, uri: str) -> str:
if os.path.isabs(uri):
return uri
ifc_path = cls.get_path()
if os.path.isfile(ifc_path):
ifc_path = os.path.dirname(ifc_path)
return (uri if not uri or os.path.isabs(uri) else os.path.join(ifc_path, uri)).replace("\\", "/")
return (uri if not uri else os.path.join(ifc_path, uri)).replace("\\", "/")
@classmethod
def get_relative_uri(cls, uri):