mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fix up Plugin.contributors and a couple contributors dicts.
This commit is contained in:
parent
44ef2bd81a
commit
df73547745
@ -42,7 +42,7 @@ __author__ = supybot.authors.jemfinch
|
|||||||
|
|
||||||
# This is a dictionary mapping supybot.Author instances to lists of
|
# This is a dictionary mapping supybot.Author instances to lists of
|
||||||
# contributions.
|
# contributions.
|
||||||
__contributors__ = {supybot.authors.jamessan:'whois'}
|
__contributors__ = {supybot.authors.jamessan: ['whois']}
|
||||||
|
|
||||||
import config
|
import config
|
||||||
import plugin
|
import plugin
|
||||||
|
@ -42,7 +42,7 @@ __author__ = supybot.authors.jemfinch
|
|||||||
|
|
||||||
# This is a dictionary mapping supybot.Author instances to lists of
|
# This is a dictionary mapping supybot.Author instances to lists of
|
||||||
# contributions.
|
# contributions.
|
||||||
__contributors__ = {supybot.Author('Keith Jones', 'kmj', ''): 'convert'}
|
__contributors__ = {supybot.Author('Keith Jones', 'kmj', ''): ['convert']}
|
||||||
|
|
||||||
import config
|
import config
|
||||||
import plugin
|
import plugin
|
||||||
|
@ -147,12 +147,12 @@ class Plugin(callbacks.Plugin):
|
|||||||
contrib = 'has no contributors listed.'
|
contrib = 'has no contributors listed.'
|
||||||
hasAuthor = False
|
hasAuthor = False
|
||||||
hasContribs = False
|
hasContribs = False
|
||||||
if getattr(module, '__author__', None):
|
if hasattr(module, '__author__'):
|
||||||
if module.__author__ != supybot.authors.unknown:
|
if module.__author__ != supybot.authors.unknown:
|
||||||
author = 'was written by %s' % \
|
author = 'was written by %s' % \
|
||||||
utils.web.mungeEmail(str(module.__author__))
|
utils.web.mungeEmail(str(module.__author__))
|
||||||
hasAuthor = True
|
hasAuthor = True
|
||||||
if getattr(module, '__contributors__', None):
|
if hasattr(module, '__contributors__'):
|
||||||
contribs = sortAuthors()
|
contribs = sortAuthors()
|
||||||
if hasAuthor:
|
if hasAuthor:
|
||||||
try:
|
try:
|
||||||
@ -175,7 +175,14 @@ class Plugin(callbacks.Plugin):
|
|||||||
for the requested plugin
|
for the requested plugin
|
||||||
"""
|
"""
|
||||||
isAuthor = False
|
isAuthor = False
|
||||||
authorInfo = getattr(supybot.authors, nick, None)
|
authorInfo = None
|
||||||
|
moduleContribs = module.__contributors__.keys()
|
||||||
|
lnick = nick.lower()
|
||||||
|
for contrib in moduleContribs:
|
||||||
|
if contrib.nick.lower() == lnick:
|
||||||
|
authorInfo = contrib
|
||||||
|
break
|
||||||
|
authorInfo = authorInfo or getattr(supybot.authors, nick, None)
|
||||||
if not authorInfo:
|
if not authorInfo:
|
||||||
return 'The nick specified (%s) is not a registered ' \
|
return 'The nick specified (%s) is not a registered ' \
|
||||||
'contributor.' % nick
|
'contributor.' % nick
|
||||||
@ -186,8 +193,7 @@ class Plugin(callbacks.Plugin):
|
|||||||
return 'The %s plugin does not have \'%s\' listed as a ' \
|
return 'The %s plugin does not have \'%s\' listed as a ' \
|
||||||
'contributor.' % (cb.name(), nick)
|
'contributor.' % (cb.name(), nick)
|
||||||
contributions = module.__contributors__[authorInfo]
|
contributions = module.__contributors__[authorInfo]
|
||||||
if getattr(module, '__author__', False) == authorInfo:
|
isAuthor = getattr(module, '__author__', False) == authorInfo
|
||||||
isAuthor = True
|
|
||||||
(nonCommands, commands) = utils.iter.partition(lambda s: ' ' in s,
|
(nonCommands, commands) = utils.iter.partition(lambda s: ' ' in s,
|
||||||
contributions)
|
contributions)
|
||||||
results = []
|
results = []
|
||||||
|
Loading…
Reference in New Issue
Block a user