Home | History | Annotate | Download | only in Lib

Lines Matching defs:Event

1 """A generally useful event scheduler class.
19 event means calling the action function, passing it the argument
36 Event = namedtuple('Event', 'time, priority, action, argument')
47 """Enter a new event in the queue at an absolute time.
49 Returns an ID for the event which can be used to remove it,
53 event = Event(time, priority, action, argument)
54 heapq.heappush(self._queue, event)
55 return event # The ID
66 def cancel(self, event):
67 """Remove an event from the queue.
70 If the event is not in the queue, this raises ValueError.
73 self._queue.remove(event)
83 When there is a positive delay until the first event, the
84 delay function is called and the event is left in the queue;
85 otherwise, the event is removed from the queue and executed
96 just after an event is executed, a delay of 0 is executed, to
113 event = pop(q)
114 # Verify that the event was not removed or altered
116 if event is checked_event:
120 heapq.heappush(q, event)