mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
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:
@@ -196,13 +196,13 @@ class Ifc(bonsai.core.tool.Ifc):
|
|||||||
IfcStore.edited_objs.discard(obj)
|
IfcStore.edited_objs.discard(obj)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def resolve_uri(cls, uri):
|
def resolve_uri(cls, uri: str) -> str:
|
||||||
if os.path.isabs(uri):
|
if os.path.isabs(uri):
|
||||||
return uri
|
return uri
|
||||||
ifc_path = cls.get_path()
|
ifc_path = cls.get_path()
|
||||||
if os.path.isfile(ifc_path):
|
if os.path.isfile(ifc_path):
|
||||||
ifc_path = os.path.dirname(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
|
@classmethod
|
||||||
def get_relative_uri(cls, uri):
|
def get_relative_uri(cls, uri):
|
||||||
|
|||||||
Reference in New Issue
Block a user