Issue error message at plugin load if a command has no docstring.

This commit is contained in:
Valentin Lorentz 2013-06-01 16:35:47 +02:00
parent 18c671fc6c
commit f82a7c7e17

View File

@ -1039,9 +1039,10 @@ class Spec(object):
return state
def _wrap(f, specList=[], name=None, **kw):
assert hasattr(f, '__doc__')
f = internationalizeDocstring(f)
name = name or f.func_name
assert hasattr(f, '__doc__') and f.__doc__, \
'Command %r has no docstring.' % name
f = internationalizeDocstring(f)
spec = Spec(specList, **kw)
def newf(self, irc, msg, args, **kwargs):
state = spec(irc, msg, args, stateAttrs={'cb': self, 'log': self.log})