mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-10 12:59:22 +01:00
Fix for bugz0r.
This commit is contained in:
parent
0ff919b0f7
commit
a0e863deef
@ -198,12 +198,11 @@ class Observer(callbacks.Privmsg):
|
|||||||
if name not in self.registryValue('observers'):
|
if name not in self.registryValue('observers'):
|
||||||
irc.error('That\'s not a valid observer.', Raise=True)
|
irc.error('That\'s not a valid observer.', Raise=True)
|
||||||
g = self.registryValue('observers.%s' % name, value=False)
|
g = self.registryValue('observers.%s' % name, value=False)
|
||||||
regexp = g()
|
|
||||||
command = g.command()
|
command = g.command()
|
||||||
probability = g.probability()
|
probability = g.probability()
|
||||||
irc.reply('%s matches the regular expression %s and '
|
irc.reply('%s matches the regular expression %s and '
|
||||||
'runs the command %s with a probability of %s' %
|
'runs the command %s with a probability of %s' %
|
||||||
(name, regexp, command, probability))
|
(name, g, command, probability))
|
||||||
info = wrap(info, ['something'])
|
info = wrap(info, ['something'])
|
||||||
|
|
||||||
def add(self, irc, msg, args, name, probability, regexp, command):
|
def add(self, irc, msg, args, name, probability, regexp, command):
|
||||||
|
@ -55,6 +55,10 @@ class ObserverTestCase(ChannelPluginTestCase):
|
|||||||
self.assertNotError('add foo m/foo/i echo I saw foo.')
|
self.assertNotError('add foo m/foo/i echo I saw foo.')
|
||||||
self.assertRegexp('observer list', '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:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user