Open gabrielkrell opened 6 years ago
See simplify-take_picture branch. Needs to be tested.
Apparently Python doesn't much like this monkey-patching. Maybe it'd be better to make an entirely new object based off it:
Traceback (most recent call last):
File "take_picture.py", line 35, in <module>
click()
File "take_picture.py", line 15, in click
with shielded_camera() as camera:
File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/opt/finsta/camera_scripts/helpful_tools.py", line 34, in shielded_camera
camera._capture = camera.capture
AttributeError: 'PiCamera' object has no attribute '_capture'
Move code unlikely to be modified by students out of the files. Right now this code determines the file location and handles retries:
Probably, the
try
-finally
wrapper around the main body should be reduced to an importedwith
as well.