Skip to content

Commit

Permalink
remove default dest (#549)
Browse files Browse the repository at this point in the history
Co-authored-by: Mohamed Koubaa <koubaa@github.com>
  • Loading branch information
koubaa and Mohamed Koubaa authored Oct 31, 2024
1 parent c35e1f2 commit 12f695d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/ansys/dyna/core/pre/examples/download_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/ansys/dyna/core/pre/internals/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 12f695d

Please sign in to comment.