Esempio 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
 def _register(action):
     handler = Handler.get(action)
     handler.add_predicate(partial(_when, _action_id(action), desired_states, True))
     return action
 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
 def wrapper(*args, **kwargs):
     action_id = _action_id(action)
     if not was_invoked(action_id):
         action(*args, **kwargs)
         mark_invoked(action_id)
Esempio n. 5
0
 def _register(action):
     handler = Handler.get(action)
     handler.add_predicate(
         partial(_when, _action_id(action), desired_states, True))
     return action
Esempio 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)