Package driver :: Module event :: Class Event
[show private | hide private]
[frames | no frames]

Class Event

Known Subclasses:
HookEvent, InputEvent, KickEvent

The event superclass. All events should subclass this event and implement the "execute" and "__str__" methods (at a minimum).
Method Summary
  __init__(self)
  __repr__(self)
  __str__(self)
String representing the event.
  enqueue(self)
Enqueues the current Event in the engine's event queue for later execution.
  execute(self, my_engine)
This is the method that gets called after the event has been plucked off the Queue and is being handled.

Method Details

__str__(self)
(Informal representation operator)

String representing the event. This is useful for verbose mode where we log all the events we've handled.

enqueue(self)

Enqueues the current Event in the engine's event queue for later execution.

execute(self, my_engine)

This is the method that gets called after the event has been plucked off the Queue and is being handled. It takes a Engine object so it knows how to access things.

Exceptions that are kicked up and not handled by the event will get handled by the loop that dequeues and executes events. But in general, it's probably not a good thing to be throwing around unhandled exceptions.
Parameters:
my_engine - the Engine instance
           (type=Engine)

Generated by Epydoc 2.0 on Wed Jan 21 21:00:06 2004 http://epydoc.sf.net