2 import RPi.GPIO as GPIO
3 import statemachine, actor, pins, tysock, waker
4 from libtuer import logger
8 parser = argparse.ArgumentParser(description='Run a door')
9 parser.add_argument("-d", "--debug",
10 action="store_true", dest="debug",
11 help="Don't send emails")
12 args = parser.parse_args()
15 libtuer.mailAddress = []
17 # initialize GPIO stuff
18 GPIO.setmode(GPIO.BOARD)
21 the_actor = actor.Actor()
22 the_machine = statemachine.StateMachine(the_actor)
23 the_socket = tysock.TySocket(the_machine)
24 the_pins = pins.PinsWatcher(the_machine)
25 the_waker = waker.Waker(the_machine)
27 # we do the socket accept thing in the main thread
30 except KeyboardInterrupt:
31 # this is what we waited for!
32 logger.info("Got SIGINT, terminating...")