2 import RPi.GPIO as GPIO
3 import statemachine, actor, pins, tysock, waker
4 from libtuer import logger
6 # TODO: implement some arguments, e.g. --debug which does not send e-mails and prints debug stuff
8 # initialize GPIO stuff
9 GPIO.setmode(GPIO.BOARD)
12 the_actor = actor.Actor()
13 the_machine = statemachine.StateMachine(the_actor)
14 the_socket = tysock.TySocket(the_machine)
15 the_pins = pins.PinsWatcher(the_machine)
16 the_waker = waker.Waker(the_machine)
18 # we do the socket accept thing in the main thread
21 except KeyboardInterrupt:
22 # this is what we waited for!
23 logger.info("Got SIGINT, terminating...")