mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
Allow doc to be specified for getSyntax, similar to getHelp
This commit is contained in:
parent
9cc917bd36
commit
c936897488
@ -230,10 +230,13 @@ def getHelp(method, name=None, doc=None):
|
|||||||
s = '(%s) -- %s' % (ircutils.bold(s), help)
|
s = '(%s) -- %s' % (ircutils.bold(s), help)
|
||||||
return utils.str.normalizeWhitespace(s)
|
return utils.str.normalizeWhitespace(s)
|
||||||
|
|
||||||
def getSyntax(method, name=None):
|
def getSyntax(method, name=None, doc=None):
|
||||||
if name is None:
|
if name is None:
|
||||||
name = method.__name__
|
name = method.__name__
|
||||||
|
if doc is None:
|
||||||
doclines = method.__doc__.splitlines()
|
doclines = method.__doc__.splitlines()
|
||||||
|
else:
|
||||||
|
doclines = doc.splitlines()
|
||||||
return '%s %s' % (name, doclines[0])
|
return '%s %s' % (name, doclines[0])
|
||||||
|
|
||||||
class Error(Exception):
|
class Error(Exception):
|
||||||
|
Loading…
Reference in New Issue
Block a user