mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added getPluginHelp() method to return docstring for individual plugins.
This commit is contained in:
parent
b7736d83e1
commit
d13458726d
@ -47,8 +47,9 @@ class Plugin(callbacks.Plugin):
|
|||||||
Returns a useful description of how to use <plugin>, if the plugin has
|
Returns a useful description of how to use <plugin>, if the plugin has
|
||||||
one.
|
one.
|
||||||
"""
|
"""
|
||||||
if hasattr(cb, '__doc__') and cb.__doc__:
|
doc = cb.getPluginHelp()
|
||||||
irc.reply(utils.str.normalizeWhitespace(cb.__doc__))
|
if doc:
|
||||||
|
irc.reply(utils.str.normalizeWhitespace(doc))
|
||||||
else:
|
else:
|
||||||
irc.reply('That plugin is loaded, but has no plugin help.')
|
irc.reply('That plugin is loaded, but has no plugin help.')
|
||||||
help = wrap(help, ['plugin'])
|
help = wrap(help, ['plugin'])
|
||||||
|
@ -1191,6 +1191,11 @@ class PluginMixin(BasePlugin, irclib.IrcCallback):
|
|||||||
else:
|
else:
|
||||||
group.set(value)
|
group.set(value)
|
||||||
|
|
||||||
|
def getPluginHelp(self):
|
||||||
|
if hasattr(self, '__doc__'):
|
||||||
|
return self.__doc__
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
class Plugin(PluginMixin, Commands):
|
class Plugin(PluginMixin, Commands):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user