|
|
@ -128,7 +128,6 @@ class DialingState(AbstractState): |
|
|
|
return ConnectingState |
|
|
|
return ConnectingState |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TelefonapparatUserInterface(object): |
|
|
|
class TelefonapparatUserInterface(object): |
|
|
|
def __init__(self): |
|
|
|
def __init__(self): |
|
|
|
pass |
|
|
|
pass |
|
|
@ -174,7 +173,6 @@ class StateMachineController(object): |
|
|
|
print('%s -> %s' % (oldstate.__name__, newstate.__name__)) |
|
|
|
print('%s -> %s' % (oldstate.__name__, newstate.__name__)) |
|
|
|
self.__state = newstate(self) |
|
|
|
self.__state = newstate(self) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def queue_event(self, evname, *evargs, **evkwargs): |
|
|
|
def queue_event(self, evname, *evargs, **evkwargs): |
|
|
|
if not hasattr(AbstractState, 'on_%s' % (evname)): |
|
|
|
if not hasattr(AbstractState, 'on_%s' % (evname)): |
|
|
|
raise ValueError('Illegal event name: %s' % (evname)) |
|
|
|
raise ValueError('Illegal event name: %s' % (evname)) |
|
|
@ -186,10 +184,6 @@ class StateMachineController(object): |
|
|
|
self.__evqueue.put((None, None, None)) |
|
|
|
self.__evqueue.put((None, None, None)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
if __name__ == '__main__': |
|
|
|
c = StateMachineController() |
|
|
|
c = StateMachineController() |
|
|
|
|
|
|
|
|
|
|
@ -210,5 +204,3 @@ if __name__ == '__main__': |
|
|
|
|
|
|
|
|
|
|
|
c.stop() |
|
|
|
c.stop() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|