'Truncates a string after a certain number of words.
Newlines in the string will be stripped.'

def _text_words(self, length, truncate):

    words = self._wrapped.split()
    if (len(words) > length):
        words = words[:length]
        return self.add_truncation_text(u'    '.join(words), truncate)
    return u'    '.join(words)
