Made some semantic code changes

Fixed an error with properly pluralizing the word 'command' in the contributions output
This commit is contained in:
Kevin Murphy 2004-09-13 07:11:54 +00:00
parent ee9a89e6a1
commit 92ae571aca

View File

@ -716,16 +716,15 @@ class Misc(callbacks.Privmsg):
if getattr(module, '__author__', False) == authorInfo:
isAuthor = True
# XXX Partition needs moved to utils.
splitContribs = fix.partition(lambda s: ' ' in s, contributions)
(nonCommands, commands) = fix.partition(lambda s: ' ' in s,
contributions)
results = []
# XXX Assign splitContribs to specific names based on what it means
# semantically -- (foo, bar) = partition(...)
if splitContribs[1]:
if commands:
results.append(
'the %s %s' %(utils.commaAndify(splitContribs[1]),
utils.pluralize('command',splitContribs[1])))
if splitContribs[0]:
results.append('the %s' % utils.commaAndify(splitContribs[0]))
'the %s %s' %(utils.commaAndify(commands),
utils.pluralize('command',len(commands))))
if nonCommands:
results.append('the %s' % utils.commaAndify(nonCommands))
if results and isAuthor:
return '%s wrote the %s plugin and also contributed %s' % \
(fullName, plugin, utils.commaAndify(results))