diff --git a/plugins/Factoids.py b/plugins/Factoids.py index 1849f495b..1e6aef6de 100644 --- a/plugins/Factoids.py +++ b/plugins/Factoids.py @@ -178,14 +178,7 @@ class Factoids(ChannelDBHandler, callbacks.Privmsg): for result in cursor.fetchall(): factoids.append('(#%s) %s' % (counter, result[0])) counter += 1 - totalResults = len(factoids) - if ircutils.shrinkList(factoids, ', or ', 400): - s = '%s could be %s (%s shown out of %s)' % \ - (key, ', or '.join(factoids), - utils.nItems(len(factoids), 'result'), totalResults) - else: - s = '%s could be %s' % (key, ', or '.join(factoids)) - irc.reply(msg, s) + irc.reply(msg, '%r could be %s' % (key, ', or '.join(factoids))) def lock(self, irc, msg, args): """[] @@ -289,14 +282,14 @@ class Factoids(ChannelDBHandler, callbacks.Privmsg): cursor = db.cursor() cursor.execute("""SELECT fact, key_id FROM factoids ORDER BY random() - LIMIT 10""") + LIMIT 3""") if cursor.rowcount != 0: L = [] for (factoid, id) in cursor.fetchall(): cursor.execute("""SELECT key FROM keys WHERE id=%s""", id) (key,) = cursor.fetchone() L.append('"%s": %s' % (ircutils.bold(key), factoid)) - irc.reply(msg, ircutils.privmsgPayload(L, '; ', 400)) + irc.reply(msg, '; '.join(L)) else: irc.error(msg, 'I couldn\'t find a factoid.') diff --git a/plugins/FunDB.py b/plugins/FunDB.py index e6eda3521..7d094cfbb 100755 --- a/plugins/FunDB.py +++ b/plugins/FunDB.py @@ -180,7 +180,7 @@ class FunDB(callbacks.Privmsg): lenSoFar += len(s) counter -= 1 L.append(s) - irc.reply(msg, ircutils.privmsgPayload(L, '; ')) + irc.reply(msg, '; '.join(L)) def insult(self, irc, msg, args): """ @@ -551,11 +551,7 @@ class FunDB(callbacks.Privmsg): irc.reply(msg, str(cursor.fetchone()[0])) else: zipcodes = [str(t[0]) for t in cursor.fetchall()] - ircutils.shrinkList(zipcodes, ', ', 400) - if len(zipcodes) < cursor.rowcount: - random.shuffle(zipcodes) - irc.reply(msg, '(%s shown of %s): %s' % \ - (len(zipcodes), cursor.rowcount, ', '.join(zipcodes))) + irc.reply(msg, utils.commaAndify(zipcodes)) Class = FunDB diff --git a/plugins/Http.py b/plugins/Http.py index f2762997a..a5b1de0b5 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -372,7 +372,7 @@ class Http(callbacks.Privmsg): if len(defs) == 0: irc.reply(msg, 'No definitions found.') else: - s = ircutils.privmsgPayload(defs, ', or ') + s = ', or '.join(defs) irc.reply(msg, '%s could be %s' % (acronym, s)) _netcraftre = re.compile(r'whatos text -->(.*?) diff --git a/plugins/URLSnarfer.py b/plugins/URLSnarfer.py index 8bbaf88c3..b62bc4bf4 100644 --- a/plugins/URLSnarfer.py +++ b/plugins/URLSnarfer.py @@ -267,7 +267,7 @@ class URLSnarfer(callbacks.Privmsg, ChannelDBHandler): else: if nolimit: urls = ['<%s>' % t[0] for t in cursor.fetchall()] - s = ircutils.privmsgPayload(urls, ', ', 400) + s = ', '.join(urls) elif simple: s = cursor.fetchone()[0] else: diff --git a/plugins/Unix.py b/plugins/Unix.py index eb1b27a71..5a5d543ba 100644 --- a/plugins/Unix.py +++ b/plugins/Unix.py @@ -204,12 +204,8 @@ class Unix(callbacks.Privmsg): resp = 'Could not find an alternate spelling for "%s"' % word elif line[0] == '&': matches = line.split(':')[1].strip() - match_list = matches.split(', ') - total = len(match_list) - ircutils.shrinkList(match_list, ', ', 350) - shown = len(match_list) - resp = 'Possible spellings for "%s" (%d found, %d shown): %s.' % \ - (word, total, shown, ', '.join(match_list)) + resp = 'Possible spellings for %r: %s.' % \ + (word, utils.commaAndify(matches.split(', '))) else: resp = 'Something unexpected was seen in the [ai]spell output.' irc.reply(msg, resp)