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 = []
18 logger.info("Starting up...")
20 # initialize GPIO stuff
21 GPIO.setmode(GPIO.BOARD)
24 the_actor = actor.Actor()
25 the_machine = statemachine.StateMachine(the_actor)
26 the_socket = tysock.TySocket(the_machine)
27 the_pins = pins.PinsWatcher(the_machine)
28 the_waker = waker.Waker(the_machine)
30 # we do the socket accept thing in the main thread
33 except KeyboardInterrupt:
34 # this is what we waited for!
35 logger.info("Got SIGINT, terminating...")