From 2fc56d6691472c34fc5487c97b11075f0824cf36 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 18 Apr 2016 02:17:13 +0200 Subject: [PATCH] Only show first 3 of >3 quotes, fix broken multi-quote printing. --- plomlombot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)) -- 2.30.2