MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / add_event

Method add_event

dm_control/viewer/gui/base.py:34–42  ·  view source on GitHub ↗

Adds a new event to the processing queue.

(self, receivers, *args)

Source from the content-addressed store, hash-verified

32 self._events = []
33
34 def add_event(self, receivers, *args):
35 """Adds a new event to the processing queue."""
36 if not all(callable(receiver) for receiver in receivers):
37 raise TypeError('Receivers are expected to be callables.')
38 def event():
39 for receiver in list(receivers):
40 receiver(*args)
41 with self._lock:
42 self._events.append(event)
43
44 def process_events(self):
45 """Invokes each of the events in the queue.

Callers 4

_handle_key_eventMethod · 0.80
_handle_moveMethod · 0.80
_handle_buttonMethod · 0.80
_handle_scrollMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected