Stupidly Simple Finite State Machine implementation for python