Skip to content

Commit

Permalink
Convert data source paths to URLs
Browse files Browse the repository at this point in the history
In `data_sources.csv`, some target data files are preceded bya URL
(file://) while others are simply filepaths.  This appears to cause
problems when wget tries to read them, creating empty files with the
same name.

This patch forces local paths to be redefined as URLs if they exist.
Not fool-proof, but a slight improvement.
  • Loading branch information
marshallward committed May 22, 2018
1 parent c35ad47 commit a3c8328
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/get_exp_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ def main():
# Possibly try multiple sources to get file.
ret = 0
for url in src_dict[args.filename]:
# Convert local paths to URLs
if os.path.isfile(url):
url = 'file://' + url

is_local_path, local_path = get_local_path(url)

if local_path is not None:
Expand Down

0 comments on commit a3c8328

Please sign in to comment.