mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Changed canonicalize to canonize -- thanks Skorobeus!
This commit is contained in:
parent
e6beec2989
commit
571ff24155
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user