mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +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')
|
msg.tag('isError')
|
||||||
return reply(msg, s, **kwargs)
|
return reply(msg, s, **kwargs)
|
||||||
|
|
||||||
def getHelp(method, name=None):
|
def getHelp(method, name=None, doc=None):
|
||||||
if name is None:
|
if name is None:
|
||||||
name = method.__name__
|
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))
|
s = '%s %s' % (name, doclines.pop(0))
|
||||||
if doclines:
|
if doclines:
|
||||||
help = ' '.join(doclines)
|
help = ' '.join(doclines)
|
||||||
|
Loading…
Reference in New Issue
Block a user