Made a helper function tokenize(s) so it can be called instead of Tokenizer().tokenize(s)

This commit is contained in:
Jeremy Fincher 2003-03-25 22:32:14 +00:00
parent 57b2fffc0f
commit 03c50ff7b4

View File

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