From: Christian Heller Date: Mon, 18 Apr 2016 00:17:13 +0000 (+0200) Subject: Only show first 3 of >3 quotes, fix broken multi-quote printing. X-Git-Url: https://plomlompom.com/repos/do_day?a=commitdiff_plain;h=2fc56d6691472c34fc5487c97b11075f0824cf36;p=plomlombot-irc.git Only show first 3 of >3 quotes, fix broken multi-quote printing. --- diff --git a/plomlombot.py b/plomlombot.py index 66b902f..7224b29 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -180,9 +180,11 @@ def handle_command(command, argument, notice, target, session): if len(results) == 0: notice("NO QUOTES MATCHING QUERY") else: - for result in results: - notice("QUOTE #" + str(result[0] + 1) + " : " - + result[1][-1]) + if len(results) > 3: + notice("SHOWING 3 OF " + str(len(results)) + " QUOTES") + for result in results[:3]: + notice("QUOTE #" + str(result[0] + 1) + ": " + + result[1][:-1]) return else: i = random.randrange(len(lines))