From c4e1bb311e3b05d7cbef74eab66f94de91e3037c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 10 Jun 2011 13:34:31 +0200 Subject: [PATCH] remove second truncateWords function --- ox/text.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ox/text.py b/ox/text.py index 3119a9a..3a7d565 100644 --- a/ox/text.py +++ b/ox/text.py @@ -151,16 +151,6 @@ def trimString(string, num): string = string[:num - 13] + '...' + string[-10:] return string -def truncateWords(s, num): - "Truncates a string after a certain number of words." - length = int(num) - words = s.split() - if len(words) > length: - words = words[:length] - if not words[-1].endswith('...'): - words.append('...') - return ' '.join(words) - def getValidFilename(s): """ Returns the given string converted to a string that can be used for a clean