Fix for bugz0r.

This commit is contained in:
Jeremy Fincher 2004-11-11 15:25:17 +00:00
parent 0ff919b0f7
commit a0e863deef
2 changed files with 5 additions and 2 deletions

View File

@ -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):

View File

@ -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: