From f0b533098cacf86fd44d0fee42941bdc38d41c6d Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 23 Aug 2003 09:07:45 +0000 Subject: [PATCH] Added a return value to shrinkList, the number of things removed from the list. --- src/ircutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ircutils.py b/src/ircutils.py index f9c2eb470..7472f330e 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -293,8 +293,11 @@ def privmsgPayload(L, sep, limit=425): def shrinkList(L, sep='', limit=425): """Shrinks a list of strings to a given combined length of limit.""" length = len(sep) + count = 0 while reduce(operator.add, map(length.__add__, map(len, L)), 0)> limit: L.pop() + count += 1 + return count class IrcString(str):