Skip to content

Commit

Permalink
Merge pull request #1797 from sktometometo/koki_s/add-xz-option-to-do…
Browse files Browse the repository at this point in the history
…wnload-data

[jsk_data] add xz support for download_data
  • Loading branch information
k-okada authored Apr 4, 2024
2 parents 35ab7b7 + fbfa42c commit 97199e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jsk_data/src/jsk_data/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def extract_file(path, to_directory='.', chmod=True):
opener, mode, getnames = zipfile.ZipFile, 'r', lambda f: f.namelist()
elif path.endswith('.tar.gz') or path.endswith('.tgz'):
opener, mode, getnames = tarfile.open, 'r:gz', lambda f: f.getnames()
elif path.endswith('.tar.xz'):
opener, mode, getnames = tarfile.open, 'r:xz', lambda f: f.getnames()
elif path.endswith('.tar.bz2') or path.endswith('.tbz'):
opener, mode, getnames = tarfile.open, 'r:bz2', lambda f: f.getnames()
else:
Expand Down

0 comments on commit 97199e3

Please sign in to comment.