Gets the user cache dir if it is set and is a valid path.
()
| 52 | |
| 53 | |
| 54 | def _get_valid_user_cache_dir() -> Path | None: |
| 55 | """Gets the user cache dir if it is set and is a valid path.""" |
| 56 | user_cache_location = os.getenv("SEMBLE_CACHE_LOCATION") |
| 57 | if user_cache_location is None: |
| 58 | return None |
| 59 | user_cache_dir = Path(user_cache_location) |
| 60 | if not user_cache_dir.is_absolute(): |
| 61 | logger.warning("SEMBLE_CACHE_LOCATION is not an absolute path: %s", user_cache_location) |
| 62 | return None |
| 63 | |
| 64 | return user_cache_dir |
| 65 | |
| 66 | |
| 67 | def resolve_cache_folder() -> Path: |
no outgoing calls