added function to retrieve the current state
This commit is contained in:
parent
1c32668e18
commit
2f0f18a8c6
@ -110,7 +110,14 @@ class StateMachine(object):
|
|||||||
def reset(self):
|
def reset(self):
|
||||||
# TODO need to lock before calling this?
|
# TODO need to lock before calling this?
|
||||||
self.transition(self.__current_state, self._default_state)
|
self.transition(self.__current_state, self._default_state)
|
||||||
|
|
||||||
|
|
||||||
|
def current_state(self):
|
||||||
|
'''
|
||||||
|
Return the current state name.
|
||||||
|
'''
|
||||||
|
return self.__current_state
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self, state):
|
def __getitem__(self, state):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user