(self, *args)
return triggers
Extends transitions.core.Machine.get_triggers to also include parent state triggers.
Extends transitions.core.Machine.get_triggers to also include parent state triggers.
Extends transitions . core . Machine . get_triggers to also include parent state triggers .
def get_triggers(self, *args):
        """ Extends transitions.core.Machine.get_triggers to also include parent state triggers. """
        triggers = []
        with self():
            for state in args:
                state_name = state.name if hasattr(state, 'name') else state
                state_path = state_name.split(self.state_cls.separator)
                if len(state_path) > 1:  # we only need to check substates when 'state_name' refers to a substate
                    with self(state_path[0]):
                        triggers.extend(self.get_nested_triggers(state_path[1:]))
                while state_path:  # check all valid transitions for parent states
                    triggers.extend(_super(HierarchicalMachine, self).get_triggers(self.state_cls.separator.join(state_path)))
                    state_path.pop()
        return triggers
def get_triggers ( self , * args ) : triggers = [ ] with self ( ) : for state in args : state_name = state . name if hasattr ( state , 'name' ) else state state_path = state_name . split ( self . state_cls . separator ) if len ( state_path ) > 1 : # we only need to check substates when 'state_name' refers to a substate with self ( state_path [ 0 ] ) : triggers . extend ( self . get_nested_triggers ( state_path [ 1 : ] ) ) while state_path : # check all valid transitions for parent states triggers . extend ( _super ( HierarchicalMachine , self ) . get_triggers ( self . state_cls . separator . join ( state_path ) ) ) state_path . pop ( ) return triggers