From a0e863deefd2758e56ef6c15de35a2eace438431 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 11 Nov 2004 15:25:17 +0000 Subject: [PATCH] Fix for bugz0r. --- plugins/Observer.py | 3 +-- test/test_Observer.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/Observer.py b/plugins/Observer.py index 8f22479bc..7e5e4aeec 100644 --- a/plugins/Observer.py +++ b/plugins/Observer.py @@ -198,12 +198,11 @@ class Observer(callbacks.Privmsg): if name not in self.registryValue('observers'): irc.error('That\'s not a valid observer.', Raise=True) g = self.registryValue('observers.%s' % name, value=False) - regexp = g() command = g.command() probability = g.probability() irc.reply('%s matches the regular expression %s and ' 'runs the command %s with a probability of %s' % - (name, regexp, command, probability)) + (name, g, command, probability)) info = wrap(info, ['something']) def add(self, irc, msg, args, name, probability, regexp, command): diff --git a/test/test_Observer.py b/test/test_Observer.py index 94e7cad07..1a857055c 100644 --- a/test/test_Observer.py +++ b/test/test_Observer.py @@ -55,6 +55,10 @@ class ObserverTestCase(ChannelPluginTestCase): self.assertNotError('add foo m/foo/i echo I saw foo.') self.assertRegexp('observer list', 'foo') + def testInfo(self): + self.assertNotError('add foo m/foo/i echo I saw foo.') + self.assertNotRegexp('observer info foo', 'sre') + # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: