mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 01:19:26 +01:00
Change canonize => normalize
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
e922918564
commit
eff20402ac
@ -82,7 +82,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 canonized.'
|
||||
'newName must already be normalized.'
|
||||
if name != newName:
|
||||
method = getattr(cb.__class__, name)
|
||||
setattr(cb.__class__, newName, method)
|
||||
|
@ -174,11 +174,11 @@ class RSS(callbacks.Plugin):
|
||||
'Unable to download feed.'):
|
||||
self.log.debug('%s %u', s, url)
|
||||
return
|
||||
def canonize(headline):
|
||||
def normalize(headline):
|
||||
return (tuple(headline[0].lower().split()), headline[1])
|
||||
oldheadlines = set(map(canonize, oldheadlines))
|
||||
oldheadlines = set(map(normalize, oldheadlines))
|
||||
for (i, headline) in enumerate(newheadlines):
|
||||
if canonize(headline) in oldheadlines:
|
||||
if normalize(headline) in oldheadlines:
|
||||
newheadlines[i] = None
|
||||
newheadlines = filter(None, newheadlines) # Removes Nones.
|
||||
if newheadlines:
|
||||
|
@ -1078,7 +1078,7 @@ class Commands(BasePlugin):
|
||||
# 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 canonize this name: consider outFilter(self, irc, msg).
|
||||
# Don't normalize this name: consider outFilter(self, irc, msg).
|
||||
# name = canonicalName(name)
|
||||
if self.isDisabled(name):
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user