|
41 | 41 | PRODUCT_TYPE = Literal["mapdl", "mechanical", "dyna"] |
42 | 42 | SUPPORTED_VERSIONS_TYPE = Dict[int, str] |
43 | 43 |
|
44 | | -LINUX_DEFAULT_DIRS = [["/", "usr", "ansys_inc"], ["/", "ansys_inc"], ["/", "install", "ansys_inc"]] |
45 | | -LINUX_DEFAULT_DIRS = [os.path.join(*each) for each in LINUX_DEFAULT_DIRS] |
| 44 | +linux_default_dirs = [["/", "usr", "ansys_inc"], ["/", "ansys_inc"], ["/", "install", "ansys_inc"]] |
| 45 | +LINUX_DEFAULT_DIRS = [os.path.join(*each) for each in linux_default_dirs] |
46 | 46 |
|
47 | 47 | CONFIG_FILE_NAME = "config.txt" |
48 | 48 |
|
@@ -999,7 +999,7 @@ def _get_application_path( |
999 | 999 | exe_loc = _prompt_path(product) |
1000 | 1000 | _change_default_path(product, exe_loc) |
1001 | 1001 | return exe_loc |
1002 | | - |
| 1002 | + warnings.warn(f"No path found for {product} in default locations.") |
1003 | 1003 | return None |
1004 | 1004 |
|
1005 | 1005 |
|
@@ -1156,7 +1156,11 @@ def version_from_path(product: PRODUCT_TYPE, path: str) -> int: |
1156 | 1156 |
|
1157 | 1157 | """ |
1158 | 1158 | if not isinstance(path, str): |
1159 | | - raise ValueError(f"Provided path '{path}' is not a string.") |
| 1159 | + raise ValueError( |
| 1160 | + f'The provided path, "{path}", is not a valid string. ' |
| 1161 | + f'If "{product}" is not installed in the default location, use ``save-ansys-path`` ' |
| 1162 | + f"to save the path so it can be found by ``ansys-tools-path``." |
| 1163 | + ) |
1160 | 1164 | if product == "mechanical": |
1161 | 1165 | return _mechanical_version_from_path(path) |
1162 | 1166 | elif product == "mapdl": |
|
0 commit comments