From b252ae87c90465e2bbee2d372c6e0cc3c20eb642 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 29 Jul 2004 07:40:32 +0000 Subject: [PATCH] Added a value option to registryValue to allow not getting the value (and just returning the group). --- src/callbacks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index 2b80dd83f..43917cd22 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -821,16 +821,18 @@ class Privmsg(irclib.IrcCallback): elapsed = time.time() - start self.log.debug('%s took %s seconds', name, elapsed) - def registryValue(self, name, channel=None): + def registryValue(self, name, channel=None, value=True): plugin = self.name() group = conf.supybot.plugins.get(plugin) names = registry.split(name) for name in names: group = group.get(name) - if channel is None: + if channel is not None: + group = group.get(channel) + if value: return group() else: - return group.get(channel)() + return group def setRegistryValue(self, name, value, channel=None): plugin = self.name()