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
|
||||
one.
|
||||
"""
|
||||
if hasattr(cb, '__doc__') and cb.__doc__:
|
||||
irc.reply(utils.str.normalizeWhitespace(cb.__doc__))
|
||||
doc = cb.getPluginHelp()
|
||||
if doc:
|
||||
irc.reply(utils.str.normalizeWhitespace(doc))
|
||||
else:
|
||||
irc.reply('That plugin is loaded, but has no plugin help.')
|
||||
help = wrap(help, ['plugin'])
|
||||
|
@ -1191,6 +1191,11 @@ class PluginMixin(BasePlugin, irclib.IrcCallback):
|
||||
else:
|
||||
group.set(value)
|
||||
|
||||
def getPluginHelp(self):
|
||||
if hasattr(self, '__doc__'):
|
||||
return self.__doc__
|
||||
else:
|
||||
return None
|
||||
|
||||
class Plugin(PluginMixin, Commands):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user