]> jfr.im git - erebus.git/blobdiff - modlib.py
process KICKs as PARTs
[erebus.git] / modlib.py
index 89a75d48d5193b7adf5d328e1384ca27c878242c..9082326e243478756f614047b396415d8a340d6d 100644 (file)
--- a/modlib.py
+++ b/modlib.py
@@ -42,6 +42,13 @@ class modlib(object):
                self.name = (name.split("."))[-1]
 
        def modstart(self, parent):
+               #modstart can return a few things...
+               # None: unspecified success
+               # False: unspecified error
+               # modlib.error (or anything else False-y): specified error
+               # True: unspecified success
+               # non-empty string (or anything else True-y): specified success
+               #"specified" values will be printed. unspecified values will result in "OK" or "failed"
                self.parent = parent
                for cmd, func in self.hooks.iteritems():
                        self.parent.hook(cmd, func)
@@ -102,6 +109,7 @@ class modlib(object):
                        func.reqglevel = glevel
                        func.reqclevel = clevel
                        func.cmd = cmd
+                       func.module = func.__module__.split('.')[1]
 
                        for c in cmd:
                                self.hooks[c] = func