remove second truncateWords function

This commit is contained in:
j 2011-06-10 13:34:31 +02:00
parent c66787785f
commit c4e1bb311e

View file

@ -151,16 +151,6 @@ def trimString(string, num):
string = string[:num - 13] + '...' + string[-10:] string = string[:num - 13] + '...' + string[-10:]
return string 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): def getValidFilename(s):
""" """
Returns the given string converted to a string that can be used for a clean Returns the given string converted to a string that can be used for a clean