Guest User

Untitled

a guest
May 26th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. def send(self, sender, **named):
  2. """
  3. Send signal from sender to all connected receivers.
  4.  
  5. If any receiver raises an error, the error propagates back through send,
  6. terminating the dispatch loop, so it is quite possible to not have all
  7. receivers called if a raises an error.
  8.  
  9. Arguments:
  10.  
  11. sender
  12. The sender of the signal Either a specific object or None.
  13.  
  14. named
  15. Named arguments which will be passed to receivers.
  16.  
  17. Returns a list of tuple pairs [(receiver, response), ... ].
  18. """
  19. responses = []
  20. if not self.receivers:
  21. return responses
  22.  
  23. for receiver in self._live_receivers(_make_id(sender)):
  24. response = receiver(signal=self, sender=sender, **named)
  25. responses.append((receiver, response))
  26. return responses
Add Comment
Please, Sign In to add comment