mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Made some semantic code changes
Fixed an error with properly pluralizing the word 'command' in the contributions output
This commit is contained in:
parent
ee9a89e6a1
commit
92ae571aca
15
src/Misc.py
15
src/Misc.py
@ -716,16 +716,15 @@ class Misc(callbacks.Privmsg):
|
|||||||
if getattr(module, '__author__', False) == authorInfo:
|
if getattr(module, '__author__', False) == authorInfo:
|
||||||
isAuthor = True
|
isAuthor = True
|
||||||
# XXX Partition needs moved to utils.
|
# XXX Partition needs moved to utils.
|
||||||
splitContribs = fix.partition(lambda s: ' ' in s, contributions)
|
(nonCommands, commands) = fix.partition(lambda s: ' ' in s,
|
||||||
|
contributions)
|
||||||
results = []
|
results = []
|
||||||
# XXX Assign splitContribs to specific names based on what it means
|
if commands:
|
||||||
# semantically -- (foo, bar) = partition(...)
|
|
||||||
if splitContribs[1]:
|
|
||||||
results.append(
|
results.append(
|
||||||
'the %s %s' %(utils.commaAndify(splitContribs[1]),
|
'the %s %s' %(utils.commaAndify(commands),
|
||||||
utils.pluralize('command',splitContribs[1])))
|
utils.pluralize('command',len(commands))))
|
||||||
if splitContribs[0]:
|
if nonCommands:
|
||||||
results.append('the %s' % utils.commaAndify(splitContribs[0]))
|
results.append('the %s' % utils.commaAndify(nonCommands))
|
||||||
if results and isAuthor:
|
if results and isAuthor:
|
||||||
return '%s wrote the %s plugin and also contributed %s' % \
|
return '%s wrote the %s plugin and also contributed %s' % \
|
||||||
(fullName, plugin, utils.commaAndify(results))
|
(fullName, plugin, utils.commaAndify(results))
|
||||||
|
Loading…
Reference in New Issue
Block a user