From cd2b58a7d5f53eabc61ccfcd7d002aae6f4e67b2 Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 28 Aug 2006 13:13:43 +0000 Subject: [PATCH] src/callbacks.py: Allow the docstring to be passed to getHelp() --- src/callbacks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index cd71e587f..8b3e1568b 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -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)