Skip to content

Commit

Permalink
feat: add --download-timeout parser options
Browse files Browse the repository at this point in the history
  • Loading branch information
aln8 committed Sep 2, 2024
1 parent 78f3744 commit eb61684
Show file tree
Hide file tree
Showing 7 changed files with 582 additions and 299 deletions.
9 changes: 3 additions & 6 deletions src/rosdep2/gbpdistro_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
FUERTE_GBPDISTRO_URL = 'https://raw.githubusercontent.com/ros/rosdistro/' \
'master/releases/fuerte.yaml'

# seconds to wait before aborting download of gbpdistro data
DOWNLOAD_TIMEOUT = 15.0


def get_owner_name(url):
"""
Expand Down Expand Up @@ -181,7 +178,7 @@ def get_gbprepo_as_rosdep_data(gbpdistro):
return rosdep_data


def download_gbpdistro_as_rosdep_data(gbpdistro_url, targets_url=None):
def download_gbpdistro_as_rosdep_data(gbpdistro_url, timeout, targets_url=None):
"""
Download gbpdistro file from web and convert format to rosdep distro data.
Expand All @@ -197,9 +194,9 @@ def download_gbpdistro_as_rosdep_data(gbpdistro_url, targets_url=None):
# we can convert a gbpdistro file into rosdep data by following a
# couple rules
# will output a warning
targets_data = download_targets_data(targets_url=targets_url)
targets_data = download_targets_data(targets_url=targets_url, timeout=timeout)
try:
f = urlopen_gzip(gbpdistro_url, timeout=DOWNLOAD_TIMEOUT)
f = urlopen_gzip(gbpdistro_url, timeout=timeout)
text = f.read()
f.close()
gbpdistro_data = yaml.safe_load(text)
Expand Down
Loading

0 comments on commit eb61684

Please sign in to comment.