From eb7f846727926c69cf5cf6593e509ca423ded4f1 Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Thu, 18 Jun 2015 01:04:57 +0200 Subject: [PATCH] fixed gpio handling --- photobooth.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/photobooth.py b/photobooth.py index 7a2f764..96daba1 100755 --- a/photobooth.py +++ b/photobooth.py @@ -81,7 +81,7 @@ class PictureList: class Photobooth: - def __init__(self, picture_basename, picture_size, pose_time, display_time, + def __init__(self, display_size, picture_basename, picture_size, pose_time, display_time, trigger_channel, shutdown_channel, lamp_channel): self.display = GuiModule('Photobooth', display_size) self.pictures = PictureList(picture_basename) @@ -157,10 +157,10 @@ class Photobooth: def handle_gpio_event(self, channel): """Implements the actions taken for a GPIO event""" - if channel == gpio_trigger_channel: + if channel == self.trigger_channel: self.take_picture() - elif channel == gpio_shutdown_channel: - self.display.clear() + elif channel == self.shutdown_channel: + self.teardown() def handle_exception(self, msg): """Displays an error message and returns""" @@ -255,7 +255,7 @@ class Photobooth: ################# def main(): - photobooth = Photobooth(picture_basename, image_size, pose_time, display_time, + photobooth = Photobooth(picture_basename, display_size, image_size, pose_time, display_time, gpio_trigger_channel, gpio_shutdown_channel, gpio_lamp_channel) photobooth.run() photobooth.teardown()