Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/gtt-get-ncbi-assembly-tables
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def check_if_data_present_and_less_than_4_weeks_old(location):

# if both files are present (and not empty), we are checking if it was downloaded more than 4 weeks ago
# and will download if it was
if os.path.isfile(table_path) and os.path.isfile(date_retrieved_path):
if os.path.isfile(table_path) and os.path.isfile(date_retrieved_path) and os.path.getsize(date_retrieved_path) > 0:

# getting current date
curr_date = date.today()
Expand All @@ -111,6 +111,8 @@ def check_if_data_present_and_less_than_4_weeks_old(location):

# setting to date object
stored_date_list = stored_date.split(",")
if stored_date_list[0] == ",":
return(True) # the file is actually empty
stored_date = date(int(stored_date_list[0]), int(stored_date_list[1]), int(stored_date_list[2]))

# getting difference
Expand Down