mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Plugin: add missing substitution, check for supybot.authors.unknown explicitly
This commit is contained in:
parent
35a64eca38
commit
d3a2964705
@ -63,7 +63,7 @@ class Plugin(callbacks.Plugin):
|
|||||||
"""<command>
|
"""<command>
|
||||||
|
|
||||||
Returns the name of the plugin that would be used to call <command>.
|
Returns the name of the plugin that would be used to call <command>.
|
||||||
|
|
||||||
If it is not uniquely determined, returns list of all plugins that
|
If it is not uniquely determined, returns list of all plugins that
|
||||||
contain <command>.
|
contain <command>.
|
||||||
"""
|
"""
|
||||||
@ -170,7 +170,7 @@ class Plugin(callbacks.Plugin):
|
|||||||
if author != supybot.authors.unknown:
|
if author != supybot.authors.unknown:
|
||||||
s = _('The %s plugin was written by %s. ' % (cb.name(), author))
|
s = _('The %s plugin was written by %s. ' % (cb.name(), author))
|
||||||
else:
|
else:
|
||||||
s = _('The %s plugin has not been claimed by an author. ')
|
s = _('The %s plugin has not been claimed by an author. ') % cb.name()
|
||||||
|
|
||||||
contribs = getattr(module, '__contributors__', {})
|
contribs = getattr(module, '__contributors__', {})
|
||||||
if contribs:
|
if contribs:
|
||||||
@ -191,8 +191,8 @@ class Plugin(callbacks.Plugin):
|
|||||||
contributorNicks = dict((author.nick.lower(), author) for author in contributors.keys())
|
contributorNicks = dict((author.nick.lower(), author) for author in contributors.keys())
|
||||||
lnick = nick.lower()
|
lnick = nick.lower()
|
||||||
|
|
||||||
author = getattr(module, '__author__', None)
|
author = getattr(module, '__author__', supybot.authors.unknown)
|
||||||
if author and lnick == author.nick.lower():
|
if author != supybot.authors.unknown and lnick == author.nick.lower():
|
||||||
# Special case for the plugin author. We remove legacy handling of the case where
|
# Special case for the plugin author. We remove legacy handling of the case where
|
||||||
# someone is listed both as author and contributor, which should never really happen?
|
# someone is listed both as author and contributor, which should never really happen?
|
||||||
return _('%s wrote the %s plugin.') % (author, cb.name())
|
return _('%s wrote the %s plugin.') % (author, cb.name())
|
||||||
|
Loading…
Reference in New Issue
Block a user