Skip to content

Commit eb61684

Browse files
committed
feat: add --download-timeout parser options
1 parent 78f3744 commit eb61684

File tree

7 files changed

+582
-299
lines changed

7 files changed

+582
-299
lines changed

src/rosdep2/gbpdistro_support.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
FUERTE_GBPDISTRO_URL = 'https://raw.githubusercontent.com/ros/rosdistro/' \
3535
'master/releases/fuerte.yaml'
3636

37-
# seconds to wait before aborting download of gbpdistro data
38-
DOWNLOAD_TIMEOUT = 15.0
39-
4037

4138
def get_owner_name(url):
4239
"""
@@ -181,7 +178,7 @@ def get_gbprepo_as_rosdep_data(gbpdistro):
181178
return rosdep_data
182179

183180

184-
def download_gbpdistro_as_rosdep_data(gbpdistro_url, targets_url=None):
181+
def download_gbpdistro_as_rosdep_data(gbpdistro_url, timeout, targets_url=None):
185182
"""
186183
Download gbpdistro file from web and convert format to rosdep distro data.
187184
@@ -197,9 +194,9 @@ def download_gbpdistro_as_rosdep_data(gbpdistro_url, targets_url=None):
197194
# we can convert a gbpdistro file into rosdep data by following a
198195
# couple rules
199196
# will output a warning
200-
targets_data = download_targets_data(targets_url=targets_url)
197+
targets_data = download_targets_data(targets_url=targets_url, timeout=timeout)
201198
try:
202-
f = urlopen_gzip(gbpdistro_url, timeout=DOWNLOAD_TIMEOUT)
199+
f = urlopen_gzip(gbpdistro_url, timeout=timeout)
203200
text = f.read()
204201
f.close()
205202
gbpdistro_data = yaml.safe_load(text)

0 commit comments

Comments
 (0)