|
4 | 4 | import logging |
5 | 5 | import os |
6 | 6 | 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 |
8 | 8 | import warnings |
9 | 9 |
|
10 | 10 | import platformdirs |
@@ -593,9 +593,7 @@ def change_default_ansys_path(exe_loc: str) -> None: |
593 | 593 | _change_default_path("mapdl", exe_loc) |
594 | 594 |
|
595 | 595 |
|
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: |
599 | 597 | has_plugin = _has_plugin(product) |
600 | 598 | if exe_loc is None and has_plugin: |
601 | 599 | exe_loc, _ = _find_installation(product) |
@@ -887,7 +885,7 @@ def _migrate_json_config_file() -> Dict[PRODUCT_TYPE, str]: # pragma: no cover |
887 | 885 |
|
888 | 886 | @dataclass |
889 | 887 | class FileMigrationStrategy: |
890 | | - paths: list[str] |
| 888 | + paths: List[str] |
891 | 889 | migration_function: Callable[[], Dict[PRODUCT_TYPE, str]] |
892 | 890 |
|
893 | 891 | def __call__(self): |
@@ -934,6 +932,11 @@ def _read_executable_path_from_config_file(product_name: PRODUCT_TYPE) -> Option |
934 | 932 | return config_data.get(product_name, None) |
935 | 933 |
|
936 | 934 |
|
| 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 | + |
937 | 940 | def _get_application_path( |
938 | 941 | product: str, |
939 | 942 | allow_input: bool = True, |
|
0 commit comments