mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
src/callbacks.py: Allow the docstring to be passed to getHelp()
This commit is contained in:
parent
4ee1437c40
commit
cd2b58a7d5
@ -214,10 +214,13 @@ def error(msg, s, **kwargs):
|
||||
msg.tag('isError')
|
||||
return reply(msg, s, **kwargs)
|
||||
|
||||
def getHelp(method, name=None):
|
||||
def getHelp(method, name=None, doc=None):
|
||||
if name is None:
|
||||
name = method.__name__
|
||||
doclines = method.__doc__.splitlines()
|
||||
if doc is None:
|
||||
doclines = method.__doc__.splitlines()
|
||||
else:
|
||||
doclines = doc.splitlines()
|
||||
s = '%s %s' % (name, doclines.pop(0))
|
||||
if doclines:
|
||||
help = ' '.join(doclines)
|
||||
|
Loading…
Reference in New Issue
Block a user