Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counter not working, plus date based folders #1

Open
Mohoganogan opened this issue Jan 7, 2017 · 0 comments
Open

Counter not working, plus date based folders #1

Mohoganogan opened this issue Jan 7, 2017 · 0 comments

Comments

@Mohoganogan
Copy link

Mohoganogan commented Jan 7, 2017

The limited number of exposures was not working, and I added the ability to create a date based folder in the chosen directory.

Below replaces lines 94 - 106

snapcounter = 1
i = 0
while True:
rightNow = datetime.datetime.now()
newpath = r'/mnt/usb/pictures/%04d%02d%02d' % (rightNow.year, rightNow.month, rightNow.day)
if not os.path.exists(newpath):
os.makedirs(newpath)
fullfilename = "/%04d%02d%02d/%04d%02d%02d-%02d%02d%02d.jpg" % (rightNow.year, rightNow.month, rightNow.day, rightNow.year, rightNow.month, rightNow.day, rightNow.hour, rightNow.minute, rightNow.second)
fullfilename = os.path.join(args.p, fullfilename)
cam.capture(fullfilename)
cam.stop_preview()
if args.n == 0:
logging.info("Taking snapshot ({} mode)".format(mode))
else:
logging.info("Taking snapshot ({} of {}, {} mode)".format(
i + 1, args.n, mode))
i = i + 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant