summaryrefslogtreecommitdiff
path: root/Lib/sched.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-12-14 12:57:56 +0000
committerGuido van Rossum <guido@python.org>1992-12-14 12:57:56 +0000
commitf5b61d4a6188eb5f5f52467b84838d0654f3d0af (patch)
treec93404611fb1495f466ccd5695b8e80cfab870a1 /Lib/sched.py
parent8819c353e2f31befaa63a950f78ae52cc74dd31c (diff)
downloadcpython-f5b61d4a6188eb5f5f52467b84838d0654f3d0af.tar.gz
* Got entirely rid of path.py.
* Many modules: fixes for new, stricter, argument passing rules (most changes were automatic ones -- not all of this is tested!). * gwin.py: now uses mainloop.py for its main loop and window admin. * mainloop.py: always call dispatch() with event as a tuple! * Fix bug in pdb's 'clear' command -- don't set the bpt but clear it!
Diffstat (limited to 'Lib/sched.py')
-rw-r--r--Lib/sched.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/sched.py b/Lib/sched.py
index 685b2bc077..29ccc2add3 100644
--- a/Lib/sched.py
+++ b/Lib/sched.py
@@ -34,7 +34,7 @@ class scheduler:
#
# Initialize a new instance, passing the time and delay functions
#
- def init(self, (timefunc, delayfunc)):
+ def init(self, timefunc, delayfunc):
self.queue = []
self.timefunc = timefunc
self.delayfunc = delayfunc
@@ -44,14 +44,15 @@ class scheduler:
# Returns an ID for the event which can be used
# to remove it, if necessary.
#
- def enterabs(self, event):
+ def enterabs(self, time, priority, action, argument):
+ event = time, priority, action, argument
bisect.insort(self.queue, event)
return event # The ID
#
# A variant that specifies the time as a relative time.
# This is actually the more commonly used interface.
#
- def enter(self, (delay, priority, action, argument)):
+ def enter(self, delay, priority, action, argument):
time = self.timefunc() + delay
return self.enterabs(time, priority, action, argument)
#
@@ -95,6 +96,6 @@ class scheduler:
self.delayfunc(time - now)
else:
del q[0]
- void = action(argument)
+ void = apply(action, argument)
self.delayfunc(0) # Let other threads run
#