Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit fe65712

Browse files
koubaaMohamed Koubaapre-commit-ci[bot]
authored
Fix issues (#170)
Co-authored-by: Mohamed Koubaa <koubaa@github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2a638bb commit fe65712

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/ansys/tools/path/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
get_latest_ansys_installation,
2626
get_mapdl_path,
2727
get_mechanical_path,
28+
get_saved_application_path,
2829
save_dyna_path,
2930
save_mapdl_path,
3031
save_mechanical_path,
@@ -50,6 +51,7 @@
5051
"get_latest_ansys_installation",
5152
"get_mapdl_path",
5253
"get_mechanical_path",
54+
"get_saved_application_path",
5355
"get_dyna_path",
5456
"save_mapdl_path",
5557
"save_mechanical_path",

src/ansys/tools/path/path.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55
import os
66
import re
7-
from typing import Callable, Dict, Literal, Optional, Tuple, Union, cast
7+
from typing import Callable, Dict, List, Literal, Optional, Tuple, Union, cast
88
import warnings
99

1010
import platformdirs
@@ -593,9 +593,7 @@ def change_default_ansys_path(exe_loc: str) -> None:
593593
_change_default_path("mapdl", exe_loc)
594594

595595

596-
def _save_path(
597-
product: PRODUCT_TYPE, exe_loc: Optional[str] = None, allow_prompt: bool = True
598-
) -> str:
596+
def _save_path(product: str, exe_loc: Optional[str] = None, allow_prompt: bool = True) -> str:
599597
has_plugin = _has_plugin(product)
600598
if exe_loc is None and has_plugin:
601599
exe_loc, _ = _find_installation(product)
@@ -887,7 +885,7 @@ def _migrate_json_config_file() -> Dict[PRODUCT_TYPE, str]: # pragma: no cover
887885

888886
@dataclass
889887
class FileMigrationStrategy:
890-
paths: list[str]
888+
paths: List[str]
891889
migration_function: Callable[[], Dict[PRODUCT_TYPE, str]]
892890

893891
def __call__(self):
@@ -934,6 +932,11 @@ def _read_executable_path_from_config_file(product_name: PRODUCT_TYPE) -> Option
934932
return config_data.get(product_name, None)
935933

936934

935+
def get_saved_application_path(application: str) -> Optional[str]:
936+
exe_loc = _read_executable_path_from_config_file(application)
937+
return exe_loc
938+
939+
937940
def _get_application_path(
938941
product: str,
939942
allow_input: bool = True,

0 commit comments

Comments
 (0)