mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed some text to read a bit better. Still doesn't look quite perfect though
This commit is contained in:
parent
2a33262b9e
commit
3f1296a858
@ -501,8 +501,8 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
||||
ORDER BY count(key) DESC LIMIT %s""", limit)
|
||||
L = ['%s (%s)' % (ircdb.users.getUser(t[0]).name, t[1])
|
||||
for t in cursor.fetchall()]
|
||||
return 'Top %s: %s' % \
|
||||
(utils.nItems(len(L), 'author'), utils.commaAndify(L))
|
||||
return 'Most prolific %s: %s' % \
|
||||
(utils.pluralize(len(L), 'author'), utils.commaAndify(L))
|
||||
|
||||
def _mostRecent(self, cursor, limit):
|
||||
cursor.execute("""SELECT key FROM factoids
|
||||
@ -520,7 +520,8 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
||||
raise self.MostException, 'No factoids have been requested.'
|
||||
L = ['%r (%s)' % (t[0], t[1]) for t in cursor.fetchall()]
|
||||
return 'Top %s: %s' % \
|
||||
(utils.nItems(len(L), 'factoid'), utils.commaAndify(L))
|
||||
(utils.nItems(len(L), 'factoid', between='requested'),
|
||||
utils.commaAndify(L))
|
||||
|
||||
def listauth(self, irc, msg, args):
|
||||
"""<author name>
|
||||
|
@ -178,26 +178,30 @@ if sqlite is not None:
|
||||
self.prefix = userPrefix1
|
||||
self.assertNotError('moogle is <reply>moo')
|
||||
self.assertError('most popular')
|
||||
self.assertResponse('most authored', 'Top 1 author: moo (1)')
|
||||
self.assertResponse('most authored',
|
||||
'Most prolific author: moo (1)')
|
||||
self.assertResponse('most recent', "1 latest factoid: 'moogle'")
|
||||
self.assertResponse('moogle', 'moo')
|
||||
self.assertResponse('most popular', "Top 1 factoid: 'moogle' (1)")
|
||||
self.assertResponse('most popular',
|
||||
"Top 1 requested factoid: 'moogle' (1)")
|
||||
# Check plural response
|
||||
self.prefix = userPrefix2
|
||||
self.assertNotError('mogle is <reply>mo')
|
||||
self.assertResponse('most authored',
|
||||
'Top 2 authors: moo (1) and boo (1)')
|
||||
'Most prolific authors: moo (1) and boo (1)')
|
||||
self.assertResponse('most recent',
|
||||
"2 latest factoids: 'mogle' and 'moogle'")
|
||||
self.assertResponse('moogle', 'moo')
|
||||
self.assertResponse('most popular', "Top 1 factoid: 'moogle' (2)")
|
||||
self.assertResponse('most popular',
|
||||
"Top 1 requested factoid: 'moogle' (2)")
|
||||
self.assertResponse('mogle', 'mo')
|
||||
self.assertResponse('most popular',
|
||||
"Top 2 factoids: 'moogle' (2) and 'mogle' (1)")
|
||||
"Top 2 requested factoids: "
|
||||
"'moogle' (2) and 'mogle' (1)")
|
||||
# Check most author ordering
|
||||
self.assertNotError('moo is <reply>oom')
|
||||
self.assertResponse('most authored',
|
||||
'Top 2 authors: boo (2) and moo (1)')
|
||||
'Most prolific authors: boo (2) and moo (1)')
|
||||
|
||||
def testListkeys(self):
|
||||
self.assertResponse('listkeys %', 'No keys matching \'%\' found.')
|
||||
|
Loading…
Reference in New Issue
Block a user