Skip to content
Snippets Groups Projects
Commit 6b23c540 authored by Nicolas Mansard's avatar Nicolas Mansard
Browse files

Added the global "ping" function.

parent 164861c4
No related branches found
No related tags found
No related merge requests found
class Calendar:
events=dict()
def __init__(self):
self.events=dict()
self.ping = list()
def __repr__(self):
res=''
# for iter in sort(self.events.keys()):
......@@ -30,9 +32,12 @@ class Calendar:
self.registerEvent(iter, (fun.functor,fun.functor.__doc__) )
else:
self.registerEvent(iter, (fun,fun.__doc__) )
def addPing(self,f): self.ping.append(f)
def callPing(self):
for f in self.ping: f()
def run(self,iter,*args):
if iter in self.events.keys():
self.callPing()
for fun,doc in self.events[iter]:
intro = "At time "+str(iter)+": "
if doc!=None: print intro, doc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment