Exemplo n.º 1
0
 def _register(action):
     handler = Handler.get(action)
     handler.add_predicate(
         partial(_when, _action_id(action), desired_states, False))
     handler.add_args(
         filter(None, map(RelationBase.from_state, desired_states)))
     return action
Exemplo n.º 2
0
 def _register(action):
     handler = Handler.get(action)
     handler.add_predicate(partial(_when, _action_id(action), desired_states, True))
     return action
Exemplo n.º 3
0
 def _register(action):
     handler = Handler.get(action)
     handler.add_predicate(partial(_when, _action_id(action), desired_states, False))
     handler.add_args(filter(None, map(RelationBase.from_state, desired_states)))
     return action
Exemplo n.º 4
0
 def wrapper(*args, **kwargs):
     action_id = _action_id(action)
     if not was_invoked(action_id):
         action(*args, **kwargs)
         mark_invoked(action_id)
Exemplo n.º 5
0
 def _register(action):
     handler = Handler.get(action)
     handler.add_predicate(
         partial(_when, _action_id(action), desired_states, True))
     return action
Exemplo n.º 6
0
 def wrapper(*args, **kwargs):
     action_id = _action_id(action)
     if not was_invoked(action_id):
         action(*args, **kwargs)
         mark_invoked(action_id)