X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/841662dc25b40dce151a0bf7a024e55682028f18..81e4eb0f1e3e06ab476c9707fb950c0e1225d33f:/src/capture.py?ds=sidebyside diff --git a/src/capture.py b/src/capture.py index dd7f47f..b9563ff 100755 --- a/src/capture.py +++ b/src/capture.py @@ -53,7 +53,8 @@ class Capture: 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) @@ -80,7 +81,8 @@ class Capture: 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 @@ -101,6 +103,7 @@ class Capture: 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')