|
|
|
@ -229,17 +229,20 @@ def telemetered_bore_downloader(bore_ids, start_date, end_date, download_dir):
|
|
|
|
|
|
|
|
|
|
# Stop logging
|
|
|
|
|
logging.shutdown()
|
|
|
|
|
with open(log_name, 'r') as f:
|
|
|
|
|
log_data = f.read()
|
|
|
|
|
|
|
|
|
|
# Check contents of log file
|
|
|
|
|
if log_data:
|
|
|
|
|
warnings.warn(
|
|
|
|
|
'Some files failed to download. See log for details.',
|
|
|
|
|
stacklevel=2)
|
|
|
|
|
else:
|
|
|
|
|
os.remove(log_name)
|
|
|
|
|
|
|
|
|
|
if os.path.isfile(log_name)
|
|
|
|
|
with open(log_name, 'r') as f:
|
|
|
|
|
log_data = f.read()
|
|
|
|
|
|
|
|
|
|
# Check contents of log file
|
|
|
|
|
if log_data:
|
|
|
|
|
warnings.warn(
|
|
|
|
|
'Some files failed to download. See log for details.',
|
|
|
|
|
stacklevel=2)
|
|
|
|
|
else:
|
|
|
|
|
os.remove(log_name)
|
|
|
|
|
|
|
|
|
|
# Close browser
|
|
|
|
|
driver.quit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|