We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f4bc1c commit f4e5562Copy full SHA for f4e5562
direct/src/fsm/FSM.py
@@ -204,6 +204,18 @@ def getCurrentOrNextState(self):
204
finally:
205
self.fsmLock.release()
206
207
+ def getCurrentStateOrTransition(self):
208
+ # Returns the current state if we are in a state now, or the
209
+ # transition we are performing if we are currently within
210
+ # the enter or exit function for a state.
211
+ self.fsmLock.acquire()
212
+ try:
213
+ if self.state:
214
+ return self.state
215
+ return '%s -> %s' % (self.oldState, self.newState)
216
+ finally:
217
+ self.fsmLock.release()
218
+
219
def isInTransition(self):
220
self.fsmLock.acquire()
221
try:
0 commit comments