Skip to content

Commit deb421b

Browse files
author
ltetrel
committed
changing working directory to let gdown download inside destination and avoid files without extensions; increased verbosity for patoolib
1 parent 7dabec5 commit deb421b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

repo2data/repo2data.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def _archive_decompress(self):
106106
try:
107107
patoolib.extract_archive(os.path.join(self._dst_path, file)
108108
, outdir=self._dst_path
109-
, verbosity=-1
110109
, interactive=False)
111110
# now we can safely delete the archive
112111
if os.path.exists(os.path.join(self._dst_path, file)):
@@ -158,10 +157,12 @@ def _wget_download(self):
158157
def _gdrive_download(self):
159158
print("Info : Starting to download from Google drive %s ..." %(self._data_requirement_file["src"]))
160159
try:
160+
# gdown does not allow to give output dir
161+
cwd = os.getcwd()
162+
os.chdir(self._dst_path)
161163
subprocess.check_call(['gdown'
162-
, self._data_requirement_file["src"]
163-
, "-O"
164-
, self._dst_path])
164+
, self._data_requirement_file["src"]])
165+
os.chdir(cwd)
165166
except FileNotFoundError:
166167
print("Error: gdown does not appear to be installed")
167168
raise

0 commit comments

Comments
 (0)