is it really working? I really really didn't get how. So here is what I tried with it:
[code]
def test(self, irc, msg, args, channel, match=None):
irc.reply("%s" % match)
test = wrap(test, [('matches', re.compile('a'), 'no match')])
[/code]
Then I called the bot with '.test b' and it told "no match" as supposed. But then I tried with matching strings like "a" and "aaa" and the bot just returns "None". If I take 'match=None' away from function definition, the bot just raises error:
[code]ERROR 2008-03-14T01:08:20 Spec: [, 'no match')>]
ERROR 2008-03-14T01:08:20 Received args: []
ERROR 2008-03-14T01:08:20 Extra args: ['channel', 'match']
ERROR 2008-03-14T01:08:20 Uncaught exception in ['test'].
Traceback (most recent call last):
File "/home/lassizci/supybot/lib/python2.3/site-packages/supybot/callbacks.py", line 1170, in _callCommand
self.callCommand(command, irc, msg, *args, **kwargs)
File "/home/lassizci/supybot/lib/python2.3/site-packages/supybot/utils/python.py", line 62, in g
f(self, *args, **kwargs)
File "/home/lassizci/supybot/lib/python2.3/site-packages/supybot/callbacks.py", line 1156, in callCommand
method(irc, msg, *args, **kwargs)
File "/home/lassizci/supybot/lib/python2.3/site-packages/supybot/commands.py", line 906, in newf
f(self, irc, msg, args, *state.args, **state.kwargs)
TypeError: test() takes exactly 6 arguments (5 given)
ERROR 2008-03-14T01:08:20 Exception id: 0xdcca6[/code]