Tidy up log file when finished downloading

master
Dan Howe 7 years ago
parent 7f215e3a86
commit b46039be63

@ -211,14 +211,18 @@ def main():
# Tidy up console after tqdm
print('\n')
# Check contents of log file
# 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 __name__ == '__main__':

Loading…
Cancel
Save