]>
jfr.im git - erebus.git/blob - modlib.py
1 # Erebus IRC bot - Author: John Runyon
2 # module helper functions, see modules/modtest.py for usage
3 # This file is released into the public domain; see http://unlicense.org/
6 def __init__(self
, desc
):
9 return False #object will test to False
11 return '<modlib.error %r>' % self
.errormsg
23 def __init__(self
, name
):
29 def modstart(self
, parent
):
31 for cmd
, func
in self
.hooks
.iteritems():
32 self
.parent
.hook(cmd
, func
)
33 def modstop(self
, parent
):
34 for cmd
, func
in self
.hooks
.iteritems():
35 self
.parent
.unhook(cmd
, func
)
39 self
.hooks
[cmd
] = func
40 if self
.parent
is not None:
41 self
.parent
.hook(cmd
, func
)