Skip to content

Commit

Permalink
Rename parameter for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Feb 8, 2024
1 parent 3fd9dcf commit 04a4157
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tiled/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@ def asset_manifest(self, data_sources):
manifests[asset["id"]] = manifest
return manifests

def raw_export(self, directory=None, max_workers=4):
def raw_export(self, destination_directory=None, max_workers=4):
"""
Download the raw assets backing this node.
This may produce a single file or a directory.
Parameters
----------
directory : Path, optional
destination_directory : Path, optional
Destination for downloaded assets. Default is current working directory
max_workers : int, optional
Number of parallel workers downloading data. Default is 4.
Expand All @@ -292,10 +292,10 @@ def raw_export(self, directory=None, max_workers=4):
paths : List[Path]
Filepaths of exported files
"""
if directory is None:
directory = Path.cwd()
if destination_directory is None:
destination_directory = Path.cwd()
else:
directory = Path(directory)
destination_directory = Path(destination_directory)

# Import here to defer the import of rich (for progress bar).
from .download import ATTACHMENT_FILENAME_PLACEHOLDER, download
Expand All @@ -315,11 +315,11 @@ def raw_export(self, directory=None, max_workers=4):
for asset in data_source["assets"]:
if len(data_source["assets"]) == 1:
# Only one asset: keep the name simple.
base_path = directory
base_path = destination_directory
else:
# Multiple assets: Add a subdirectory named for the asset
# id to namespace each asset.
base_path = Path(directory, str(asset["id"]))
base_path = Path(destination_directory, str(asset["id"]))
if asset["is_directory"]:
relative_paths = asset_manifest[asset["id"]]
urls.extend(
Expand Down

0 comments on commit 04a4157

Please sign in to comment.