예제 #1
0
    def getTransition(self, source, transition_id):
        transition = self._id_transitions[transition_id]
        if not IState.providedBy(source):
            source = self.getState(source)

        if source not in transition.source:
            raise InvalidTransitionError

        return transition
예제 #2
0
 def getTransitions(self, source, type=ITransition):
     try:
         if IState.providedBy(source):
             return [t for t in self._sources[source].values()
                     if type.providedBy(t)]
         else:
             return [t for t in
                     self._sources[self._id_sources[source]].values()
                     if type.providedBy(t)]
     except KeyError:
         return []