Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/ansys/fluent/core/examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .downloads import download_file # noqa: F401
from .downloads import path # noqa: F401
from .downloads import download_file, path # noqa: F401
8 changes: 5 additions & 3 deletions src/ansys/fluent/core/examples/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ def download_file(


def path(filename: str):
file_path = str(Path(pyfluent.EXAMPLES_PATH) / filename)
if os.path.isfile(file_path):
return file_path
if os.path.isabs(filename):
return filename
file_path = Path(pyfluent.EXAMPLES_PATH) / filename
if file_path.is_file():
return str(file_path)
else:
raise FileNotFoundError(f"{filename} does not exist.")