Fixing download path of csv
This commit is contained in:
parent
d6242e541d
commit
de442c8fa1
@ -20,7 +20,7 @@ def get_csv():
|
|||||||
most_recent = next(filter(lambda x: yesterdays_date in x['name'], git_blob))
|
most_recent = next(filter(lambda x: yesterdays_date in x['name'], git_blob))
|
||||||
file_name = most_recent['name']
|
file_name = most_recent['name']
|
||||||
download_url = most_recent['download_url']
|
download_url = most_recent['download_url']
|
||||||
most_recent_csv = "./%s" % file_name
|
most_recent_csv = "/app/%s" % file_name
|
||||||
if not os.path.exists(most_recent_csv):
|
if not os.path.exists(most_recent_csv):
|
||||||
print("no local csv found, downloading %s" % file_name)
|
print("no local csv found, downloading %s" % file_name)
|
||||||
r = requests.get(download_url, allow_redirects=True)
|
r = requests.get(download_url, allow_redirects=True)
|
||||||
@ -31,7 +31,7 @@ def get_csv():
|
|||||||
yesterday_object = next(filter(lambda x: two_days_ago_date in x['name'], git_blob))
|
yesterday_object = next(filter(lambda x: two_days_ago_date in x['name'], git_blob))
|
||||||
yesterday_filename = yesterday_object['name']
|
yesterday_filename = yesterday_object['name']
|
||||||
yesterday_url = yesterday_object['download_url']
|
yesterday_url = yesterday_object['download_url']
|
||||||
yesterday_csv = "./%s" % yesterday_filename
|
yesterday_csv = "/app/%s" % yesterday_filename
|
||||||
|
|
||||||
if not os.path.exists(yesterday_csv):
|
if not os.path.exists(yesterday_csv):
|
||||||
print("no local csv found, downloading %s" % yesterday_filename)
|
print("no local csv found, downloading %s" % yesterday_filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user