def live(self, q):
"""Run live preview on the screen."""
clock = pygame.time.Clock()
- while True:
+ done = False
+ while not done:
if q:
try:
line = q.get_nowait() # or q.get(timeout=.1)
last = 0
clock = pygame.time.Clock()
- while True:
+ done = False
+ while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
def take(self):
"""Take a new image from the camera."""
+ print "taking pic"
im = self.cam.get_image()
self.screen.display_picture(im)
im.save(self.saving_dir + "{0:0>3}.jpg".format(self.im_number), 'JPEG')