Skip to content

Commit d574d5c

Browse files
Update downloads.py (#4543)
Co-authored-by: Samuel Lopez <[email protected]>
1 parent 85bd251 commit d574d5c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pyaedt/downloads.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ def download_twin_builder_data(file_name, force_download=False, destination=None
734734
return os.path.join(destination, "twin_builder")
735735

736736

737-
@pyaedt_function_handler(filename="name")
738-
def download_file(directory, name=None, destination=None):
737+
@pyaedt_function_handler(filename="name", directory="source")
738+
def download_file(source, name=None, destination=None):
739739
"""
740740
Download a file or files from the online examples repository.
741741
@@ -746,9 +746,10 @@ def download_file(directory, name=None, destination=None):
746746
747747
Parameters
748748
----------
749-
directory : str
750-
Directory name in the Ansys ``example-data`` repository. If the ``pyaed/`` prefix
751-
is not part of ``directory`` it will be prepended.
749+
source : str
750+
Directory name in the Ansys ``example-data`` repository from which the example
751+
data is to be retrieved. If the ``pyaedt/`` prefix
752+
is not part of ``directory`` the path will be automatically prepended.
752753
name : str, optional
753754
File name to download. By default all files in ``directory``
754755
will be downloaded.
@@ -770,13 +771,13 @@ def download_file(directory, name=None, destination=None):
770771
'C:/Users/user/AppData/local/temp/PyAEDTExamples/motorcad'
771772
"""
772773
local_paths = []
773-
_download_file(directory, name, destination, local_paths)
774+
_download_file(source, name, destination, local_paths)
774775
if name:
775776
return list(set(local_paths))[0]
776777
else:
777778
if not destination:
778779
destination = EXAMPLES_PATH
779-
destination_dir = os.path.join(destination, directory)
780+
destination_dir = os.path.join(destination, source)
780781
return destination_dir
781782

782783

0 commit comments

Comments
 (0)