We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64863b7 commit 17484f2Copy full SHA for 17484f2
dials_data/download.py
@@ -2,6 +2,7 @@
2
3
import contextlib
4
import os
5
+import tarfile
6
7
import dials_data.datasets
8
from six.moves.urllib.request import urlopen
@@ -180,6 +181,12 @@ def _fetch_filelist(filelist, file_hash):
180
181
print("Downloading {}".format(source["url"]))
182
_download_to_file(source["url"], source["file"])
183
184
+ # If the file is a tar archive, then decompress
185
+ if tarfile.is_tarfile(source["file"]):
186
+ print(f"Decompressing {source['file']}")
187
+ with tarfile.open(source["file"]) as tar:
188
+ tar.extractall(path=source["file"].dirname)
189
+
190
# verify
191
valid = True
192
fileinfo = {
0 commit comments