def sendEvent(self,event,data=None):
if self.cfg["<STR_LIT>"]!="<STR_LIT>" and event not in self.event_list:<EOL><INDENT>self.event_list.add(event)<EOL><DEDENT>if event not in self.eventHandlers:<EOL><INDENT>if event not in self.events_ignored or self.events_ignored[event]<=self.cfg["<STR_LIT>"]: <EOL><INDENT>self.events_ignored[event] = self.events_ignored.get(event,<NUM_LIT:0>)+<NUM_LIT:1><EOL><DEDENT>return<EOL><DEDENT>for handler in self.eventHandlers[event]:<EOL><INDENT>f = handler[<NUM_LIT:0>]<EOL>try:<EOL><INDENT>f(event,data)<EOL><DEDENT>except Exception:<EOL><INDENT>if not handler[<NUM_LIT:1>]:<EOL><INDENT>raise<EOL><DEDENT>else:<EOL><INDENT>if self.cfg["<STR_LIT>"]:<EOL><INDENT>self.delEventListener(event,f)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Sends an event with attached data.

``event`` should be a string of format ``<namespace>:<category1>.<subcategory2>.<name>``\ .
There may be an arbitrary amount of subcategories. Also note that this
format is not strictly enforced, but rather recommended by convention.

``data`` may be any Python Object, but it usually is a dictionary containing relevant parameters.
For example, most built-in events use a dictionary containing at least the ``peng`` key set to an instance of this class.

If there are no handlers for the event, a corresponding message will be printed to the log file.
To prevent spam, the maximum amount of ignored messages can be configured via :confval:`events.maxignore` and defaults to 3.

If the config value :confval:`debug.events.dumpfile` is a file path, the event type will be added to an internal list and be saved to the given file during program exit.