From d55cc5872503567775f0d7a7731d6f489bf2299b Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 12 Nov 2017 15:03:09 +0100 Subject: yapf -ir --- poezio/timed_events.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'poezio/timed_events.py') diff --git a/poezio/timed_events.py b/poezio/timed_events.py index 8ce94407..f203bf19 100644 --- a/poezio/timed_events.py +++ b/poezio/timed_events.py @@ -4,7 +4,6 @@ # # Poezio is free software: you can redistribute it and/or modify # it under the terms of the zlib license. See the COPYING file. - """ Timed events are the standard way to schedule events for later in poezio. @@ -15,11 +14,13 @@ Once created, they must be added to the list of checked events with import datetime + class DelayedEvent(object): """ A TimedEvent, but with the date calculated from now + a delay in seconds. Use it if you want an event to happen in, e.g. 6 seconds. """ + def __init__(self, delay, callback, *args): """ Create a new DelayedEvent. @@ -34,12 +35,14 @@ class DelayedEvent(object): # An asyncio handler, as returned by call_later() or call_at() self.handler = None + class TimedEvent(DelayedEvent): """ An event with a callback that is called when the specified time is passed. The callback and its arguments should be passed as the lasts arguments. """ + def __init__(self, date, callback, *args): """ Create a new timed event. -- cgit v1.2.3