diff --git a/src/ansys/dyna/core/pre/examples/download_utilities.py b/src/ansys/dyna/core/pre/examples/download_utilities.py index 75f7e29bf..2581da924 100644 --- a/src/ansys/dyna/core/pre/examples/download_utilities.py +++ b/src/ansys/dyna/core/pre/examples/download_utilities.py @@ -4,7 +4,7 @@ from urllib.parse import urljoin import urllib.request -import ansys.meshing.prime.internals.defaults as defaults +from ansys.dyna.core.pre.internals.defaults import EXAMPLES_PATH __all__ = ["DownloadManager"] @@ -124,8 +124,8 @@ def _retrieve_url(self, url, dest): return saved_file def _retrieve_data(self, url: str, filename: str, dest: str = None, force: bool = False): - if dest is None: - dest = defaults.get_examples_path() + if dest == None: + dest = EXAMPLES_PATH local_path = os.path.join(dest, os.path.basename(filename)) if not force and os.path.isfile(local_path): return local_path diff --git a/src/ansys/dyna/core/pre/internals/defaults.py b/src/ansys/dyna/core/pre/internals/defaults.py index ccd5bdf1e..12f748b27 100644 --- a/src/ansys/dyna/core/pre/internals/defaults.py +++ b/src/ansys/dyna/core/pre/internals/defaults.py @@ -17,14 +17,14 @@ try: import appdirs - USER_DATA_PATH = os.getenv("PYPRIMEMESH_USER_DATA", appdirs.user_data_dir(appname="pyprimemesh", appauthor=False)) + USER_DATA_PATH = os.getenv("PYDYNA_USER_DATA", appdirs.user_data_dir(appname="pydyna", appauthor=False)) except ModuleNotFoundError: # If appdirs is not installed, then try with tempfile. # NOTE: This only occurs for ADO ARM Test runs import tempfile - USER_NAME = os.getenv("USERNAME", os.getenv("USER", "pyprimemesh")) - USER_DATA_PATH = os.getenv("PYPRIMEMESH_USER_DATA", os.path.join(tempfile.gettempdir(), USER_NAME)) + USER_NAME = os.getenv("USERNAME", os.getenv("USER", "pydyna")) + USER_DATA_PATH = os.getenv("PYDYNA_USER_DATA", os.path.join(tempfile.gettempdir(), USER_NAME)) if not os.path.exists(USER_DATA_PATH): # pragma: no cover os.makedirs(USER_DATA_PATH)