Use StopIteration instead of sys.exit() to end image capture

hightide
Dan Howe 5 years ago
parent a65de58d14
commit b4867a2629

@ -4,7 +4,6 @@ Open an automated selenium webdriver, and download images from Live View mode.
"""
import os
import sys
import glob
import time
import pytz
@ -175,7 +174,7 @@ def get_next_image(driver, cookies):
# Check if recording has completed
if t[-1] - t[0] > RECORDING_DURATION:
sys.exit()
raise(StopIteration)
# Count images collected
n = len(t)
@ -211,6 +210,9 @@ def main():
# Attempt to re-login if server goes down
time.sleep(5)
cookies = login(driver)
except StopIteration:
# Stop when recording has completed
break
# Create counter

Loading…
Cancel
Save