From 2f0f18a8c62db21fa3ba8cc87a6d190aca205c30 Mon Sep 17 00:00:00 2001 From: Thom Nichols Date: Thu, 3 Jun 2010 08:07:56 -0400 Subject: added function to retrieve the current state --- sleekxmpp/xmlstream/statemachine.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/statemachine.py b/sleekxmpp/xmlstream/statemachine.py index c5f51765..065d5794 100644 --- a/sleekxmpp/xmlstream/statemachine.py +++ b/sleekxmpp/xmlstream/statemachine.py @@ -110,7 +110,14 @@ class StateMachine(object): def reset(self): # TODO need to lock before calling this? 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): ''' -- cgit v1.2.3