added __str__

This commit is contained in:
Thom Nichols
2010-06-07 13:58:15 -04:00
parent 47f1fb1690
commit 9464736551
2 changed files with 9 additions and 2 deletions

View File

@@ -163,6 +163,10 @@ class StateMachine(object):
Use `StateMachine.ensure(state)` to wait until the machine enters a certain state.
'''
return self.__current_state == state
def __str__(self):
return "".join(( "StateMachine(", ','.join(self.__states), "): ", self.__current_state ))
class _StateCtx: