From cca36ed9f2681dc972933aac7b6724eb417538aa Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 18 May 2009 11:09:18 -0400 Subject: [PATCH] Factoids: Add simpleSyntax argument to getCommandHelp. It helps to properly override the parent class's method so that Misc.help doesn't error when trying to get Factoids.learn's help. Signed-off-by: James Vega --- plugins/Factoids/plugin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/Factoids/plugin.py b/plugins/Factoids/plugin.py index edfda64a9..390092aef 100644 --- a/plugins/Factoids/plugin.py +++ b/plugins/Factoids/plugin.py @@ -104,7 +104,7 @@ class Factoids(callbacks.Plugin, plugins.ChannelDBHandler): db.commit() return db - def getCommandHelp(self, command): + def getCommandHelp(self, command, simpleSyntax=None): method = self.getCommandMethod(command) if method.im_func.func_name == 'learn': chan = None @@ -112,12 +112,15 @@ class Factoids(callbacks.Plugin, plugins.ChannelDBHandler): chan = dynamic.msg.args[0] s = self.registryValue('learnSeparator', chan) help = callbacks.getHelp - if conf.get(conf.supybot.reply.showSimpleSyntax, chan): + if simpleSyntax is None: + simpleSyntax = conf.get(conf.supybot.reply.showSimpleSyntax, + chan) + if simpleSyntax: help = callbacks.getSyntax return help(method, doc=method._fake__doc__ % (s, s), name=callbacks.formatCommand(command)) - return super(Factoids, self).getCommandHelp(command) + return super(Factoids, self).getCommandHelp(command, simpleSyntax) def learn(self, irc, msg, args, channel, key, factoid): db = self.getDb(channel)