Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Check valid name and file #5383

Merged
merged 2 commits into from
Nov 6, 2024
Merged
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
7 changes: 6 additions & 1 deletion src/ansys/aedt/core/workflows/installer/extension_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ def button_is_clicked(
name = selected_toolkit_info.get("name")
icon = os.path.abspath(os.path.join(product_path, selected_toolkit_info.get("icon")))

valid_name = name is not None and not os.path.isdir(name)
valid_file = file is not None and os.path.isfile(file)

if selected_toolkit_name != "Custom" and selected_toolkit_info.get("pip"):
if is_toolkit_installed(selected_toolkit_name, toolkit_level) and install_action:
desktop.logger.info(f"Updating {selected_toolkit_name}")
Expand All @@ -277,7 +280,8 @@ def button_is_clicked(
else:
desktop.logger.info(f"{selected_toolkit_name} not installed")

else:
elif valid_name and valid_file:

if install_action:
desktop.logger.info("Install {}".format(name))

Expand All @@ -287,6 +291,7 @@ def button_is_clicked(
file = os.path.join(
os.path.dirname(ansys.aedt.core.workflows.templates.__file__), "extension_template.py"
)

if os.path.isfile(executable_interpreter):
template_file = "run_pyaedt_toolkit_script"
if selected_toolkit_info:
Expand Down
Loading