From 843b6d0d0206b1ad96e045f9d20756eb1268e438 Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 18 Mar 2009 14:41:02 -0400 Subject: [PATCH] Config: Show global and channel values for Config.config Signed-off-by: James Vega --- plugins/Config/plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/Config/plugin.py b/plugins/Config/plugin.py index 21ea0ce31..1ca26757d 100644 --- a/plugins/Config/plugin.py +++ b/plugins/Config/plugin.py @@ -161,8 +161,11 @@ class Config(callbacks.Plugin): irc.reply('There were no matching configuration variables.') search = wrap(search, ['lowered']) # XXX compose with withoutSpaces? - def _getValue(self, irc, msg, group): + def _getValue(self, irc, msg, group, addChannel=False): value = str(group) or ' ' + if addChannel and irc.isChannel(msg.args[0]) and not irc.nested: + s = str(group.get(msg.args[0])) + value = 'Global: %s; %s: %s' % (value, msg.args[0], s) if hasattr(group, 'value'): if not group._private: irc.reply(value) @@ -215,7 +218,7 @@ class Config(callbacks.Plugin): if value is not None: self._setValue(irc, msg, group, value) else: - self._getValue(irc, msg, group) + self._getValue(irc, msg, group, addChannel=group.channelValue) config = wrap(config, ['settableConfigVar', additional('text')]) def help(self, irc, msg, args, group):