Merge lp:~keegan-csmith/ibid/memoplurality-634257 into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Keegan Carruthers-Smith on 2010-09-26
Status: Merged
Approved by: Stefano Rivera on 2011-01-21
Approved revision: 996
Merged at revision: 1001
Proposed branch: lp:~keegan-csmith/ibid/memoplurality-634257
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 45 lines (+11/-6)
2 files modified
ibid/plugins/memo.py (+10/-5)
ibid/utils/__init__.py (+1/-1)
To merge this branch: bzr merge lp:~keegan-csmith/ibid/memoplurality-634257
Reviewer Review Type Date Requested Status
Max Rabkin Approve on 2011-01-21
Stefano Rivera 2010-09-26 Approve on 2011-01-21
marcog (community) Approve on 2011-01-21
Review via email: mp+36665@code.launchpad.net

Commit message

Use correct plurality in pending memos message

To post a comment you must log in.
Stefano Rivera (stefanor) wrote :

You are using plural() the wrong way around

The whole message_str thing could be rolled into a multi-line {}, but I have no objections to it, just different style to my normal add_response...

u'Would you like to read them now?' <- are people going to complain about that now? :)

review: Needs Fixing
Max Rabkin (max-rabkin) wrote :

You should pass the whole message to plural. This makes translation easier, in theory.

review: Needs Fixing
963. By Keegan Carruthers-Smith on 2010-09-28

Add "weather forecast for" syntax to weather
Author: Keegan Carruthers-Smith
Approved by: Stefano Rivera

964. By Max Rabkin on 2010-09-29

[SECURITY] Don't leak private messages to meeting logs.
Author: Max Rabkin
Approved by: Stefano Rivera

965. By Stefano Rivera on 2010-09-30

Use locale.getpreferredencoding instead of attempting to parse LANG
Author: Stefano Rivera
Approved by: Stefano Rivera

966. By Stefano Rivera on 2010-09-30

Handle 0 tweets in Twitter Atom feed parsing, correctly handle it elsewhere instead of treating it as no such twit
Author: Stefano Rivera
Approved by: Stefano Rivera

967. By Stefano Rivera on 2010-09-30

Be clear that ibid is in Debian & Ubuntu
Author: Stefano Rivera
Approved by: Stefano Rivera

968. By Stefano Rivera on 2010-09-30

Include notifying users in feed help
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin
Fixes LP: #605584

969. By Stefano Rivera on 2010-10-01

Attribute Kevin (tarmac didn't land that revision). Max is now ibid-core

970. By Stefano Rivera on 2010-10-02

[SECURITY] Add a configuration glob-list of channels which should have public logs, rather than attempting to guess.
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin, Keegan Carruthers-Smith
Fixes LP: #

Stefano Rivera (stefanor) wrote :

This bug is targetted at 0.1, it would be nice to see a merge proposal there too...

971. By Stefano Rivera on 2010-10-04

Get rid of (and disallow) empty factoid names
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin
Fixes LP: #606065

972. By Max Rabkin on 2010-10-04

Don't double-address in memo delivery
Author: Max Rabkin
Approved by: Jonathan Hitchcock, Stefano Rivera, marcog
Fixes LP: #

973. By Guy Halse on 2010-10-04

Allow bot to identify with zanet.net's NickServ
Author: Stefano Rivera
Approved by: Max Rabkin, Jonathan Hitchcock
Fixes LP: #652000

974. By Stefano Rivera on 2010-10-05

Correct mistake in r963, weather forecast

975. By Stefano Rivera on 2010-10-15

Always respond to memo sending with confirmation of recipient. Allow memos to begin with "on ..." when not naming a known source.
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, marcog, Max Rabkin
Fixes LP: #634253

976. By Stefano Rivera on 2010-10-15

Support twitter's new AJAX URLs
Author: Stefano Rivera
Approved by: Max Rabkin, marcog, Jonathan Hitchcock
Fixes LP: #654535

977. By Max Rabkin on 2010-11-07

Don't treat feeds with no messages as errors
Author: Max Rabkin
Approved by: Jonathan Hitchcock, Stefano Rivera
Fixes LP: #661187

978. By Stefano Rivera on 2010-11-07

Put periodic lock-using code in a try...finally block
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin
Fixes LP: #

979. By Max Rabkin on 2010-11-07

Improve robustness of debug plugin, esp wrt non-message events.
Author: Max Rabkin
Approved by: Jonathan Hitchcock, Stefano Rivera
Fixes LP: #655643

980. By Stefano Rivera on 2010-11-07

Some (state) events have no channel
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin
Fixes LP: #656349

981. By Stefano Rivera on 2010-11-07

Port google scrape search to get_html_parse_tree + etree. Handle superscript in gcalc.
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin
Fixes LP: #580696

982. By Stefano Rivera on 2010-11-07

Support toilet fonts, correctly decode utf-8 figlet output, handle font choice edge cases
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin
Fixes LP: #607743

983. By Stefano Rivera on 2010-12-20

Check for ; in a line before splitting by semi-colons
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, marcog, Max Rabkin
Fixes LP: #692347

984. By Stefano Rivera on 2010-12-24

Use absolute imports to import SILC correctly
Author: Stefano Rivera
Approved by: Max Rabkin, Jonathan Hitchcock
Fixes LP: #654202

985. By Stefano Rivera on 2010-12-24

Rework nickserv auth to allow simultaneous authentications for the same nick (although Nickserv will only be bothered once)
Author: Stefano Rivera
Approved by: Max Rabkin, Jonathan Hitchcock
Fixes LP: #655647

986. By Stefano Rivera on 2010-12-24

Follow redirects in "is it up"
Author: Stefano Rivera
Approved by: Max Rabkin, Jonathan Hitchcock
Fixes LP: #599410

987. By Stefano Rivera on 2010-12-24

Logs in logs might not be in recent_logs (we love you, GC)
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, Max Rabkin
Fixes LP: #655645

988. By Max Rabkin on 2011-01-09

Update unihan scraper for new website layout.
Author: Max Rabkin
Approved by: marcog, Stefano Rivera
Fixes LP: #626439

989. By marcog on 2011-01-17

Check content_type is set before checking its value
Author: marcog
Approved by: Stefano Rivera, Jonathan Hitchcock
Fixes LP: #701900

990. By marcog on 2011-01-18

New gameservers Processor: Teeworlds
Author: Ibid Dev Team
Approved by: Stefano Rivera, Michael Gorven, Keegan Carruthers-Smith
Fixes LP: #

991. By Max Rabkin on 2011-01-19

Use new OEIS API at oeis.org
Author: Max Rabkin
Approved by: marcog, Stefano Rivera
Fixes LP: #700475

992. By Max Rabkin on 2011-01-19

Show hidden categories in help to admin users.
Author: Max Rabkin
Approved by: Stefano Rivera, marcog
Fixes LP: #618921

Stefano Rivera (stefanor) wrote :

Keegan: ping

993. By Stefano Rivera on 2011-01-19

Strip tags from gcalc response
Author: Stefano Rivera
Approved by: Max Rabkin, marcog
Fixes LP: #702371

994. By Stefano Rivera on 2011-01-19

Handle non-500 error codes from twitter
Author: Stefano Rivera
Approved by: marcog, Max Rabkin
Fixes LP: #670855

995. By Adrianna Pińska on 2011-01-19

Extend the functionality of the logging plugin to allow specific channels to be logged or not.
Author: Adrianna Pińska
Approved by: Max Rabkin, Stefano Rivera
Fixes LP: #698100

996. By Keegan Carruthers-Smith on 2011-01-21

Memo's message count string uses the singular correctly now.

marcog (marco-gallotta) :
review: Approve
Stefano Rivera (stefanor) :
review: Approve
Max Rabkin (max-rabkin) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/memo.py'
2--- ibid/plugins/memo.py 2010-10-15 12:40:50 +0000
3+++ ibid/plugins/memo.py 2011-01-21 21:01:55 +0000
4@@ -15,7 +15,7 @@
5 from ibid.db.models import Identity, Account
6 from ibid.auth import permission
7 from ibid.plugins.identity import get_identities
8-from ibid.utils import ago, format_date
9+from ibid.utils import ago, format_date, plural
10
11 features = {'memo': {
12 'description': u'Keeps messages for people.',
13@@ -320,10 +320,15 @@
14 u' so ask me in private.',
15 len(memos), target=event.sender['connection'], address=False)
16 elif len(memos) > 0:
17- event.addresponse(u'You have %s messages. '
18- u"Would you like to read them now?",
19- len(memos),
20- target=event.sender['connection'], address=False)
21+ event.addresponse(
22+ plural(
23+ len(memos),
24+ u'You have %(memo_count)d message. '
25+ u'Would you like to read it now?',
26+ u'You have %(memo_count)d messages. '
27+ u'Would you like to read them now?'),
28+ { 'memo_count' : len(memos) },
29+ target=event.sender['connection'])
30 else:
31 nomemos_cache.add(event.identity)
32
33
34=== modified file 'ibid/utils/__init__.py'
35--- ibid/utils/__init__.py 2010-12-19 22:07:04 +0000
36+++ ibid/utils/__init__.py 2011-01-21 21:01:55 +0000
37@@ -276,7 +276,7 @@
38 .join(filter(None, [separator.join(items[:-1])] + items[-1:])))
39
40 def plural(count, singular, plural):
41- "Return sigular or plural depending on count"
42+ "Return singular or plural depending on count"
43 if count == 1:
44 return singular
45 return plural

Subscribers

People subscribed via source and target branches