From 03c50ff7b426d9c969298c03581254058b19c001 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 25 Mar 2003 22:32:14 +0000 Subject: [PATCH] Made a helper function tokenize(s) so it can be called instead of Tokenizer().tokenize(s) --- src/callbacks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index c200cb42b..b12c75f24 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -197,6 +197,8 @@ class Tokenizer: args.append(self.handleToken(token)) return args +def tokenize(s): + return Tokenizer.tokenize(s) class IrcObjectProxy: def __init__(self, irc, msg, args): @@ -285,7 +287,7 @@ class Privmsg(irclib.IrcCallback): msg = self.rateLimiter.get() if msg: s = addressed(irc.nick, msg) - self.Proxy(irc, msg, Tokenizer().tokenize(s)) + self.Proxy(irc, msg, tokenize(s)) def isCommand(self, methodName): # This function is ugly, but I don't want users to call methods like @@ -323,7 +325,7 @@ class Privmsg(irclib.IrcCallback): if m and self.isCommand(canonicalName(m.group(1))): self.rateLimiter.put(msg) msg = self.rateLimiter.get() - self.Proxy(irc, msg, Tokenizer().tokenize(s)) + self.Proxy(irc, msg, tokenize(s)) class IrcObjectProxyRegexp: