Changed canonicalize to canonize -- thanks Skorobeus!

This commit is contained in:
Jeremy Fincher 2005-02-04 03:19:05 +00:00
parent e6beec2989
commit 571ff24155
3 changed files with 5 additions and 5 deletions

View File

@ -75,7 +75,7 @@ def registerRename(plugin, command=None, newName=None):
def renameCommand(cb, name, newName):
assert not hasattr(cb, newName), 'Cannot rename over existing attributes.'
assert newName == callbacks.canonicalName(newName), \
'newName must already be canonicalized.'
'newName must already be canonized.'
if name != newName:
method = getattr(cb.__class__, name)
setattr(cb.__class__, newName, method)

View File

@ -141,11 +141,11 @@ class RSS(callbacks.Privmsg):
oldheadlines = []
newresults = self.getFeed(url)
newheadlines = self.getHeadlines(newresults)
def canonicalize(headline):
def canonize(headline):
return (tuple(headline[0].lower().split()), headline[1])
oldheadlines = set(map(canonicalize, oldheadlines))
oldheadlines = set(map(canonize, oldheadlines))
for (i, headline) in enumerate(newheadlines):
if canonicalize(headline) in oldheadlines:
if canonize(headline) in oldheadlines:
newheadlines[i] = None
newheadlines = filter(None, newheadlines) # Removes Nones.
if newheadlines:

View File

@ -1099,7 +1099,7 @@ class Privmsg(irclib.IrcCallback):
# This function is ugly, but I don't want users to call methods like
# doPrivmsg or __init__ or whatever, and this is good to stop them.
# Don't canonicalize this name: consider outFilter(self, irc, msg).
# Don't canonize this name: consider outFilter(self, irc, msg).
# name = canonicalName(name)
if self.isDisabled(name):
return False