#NEWLINE# def truncate_letters( s , num ) : #NEWLINE# #INDENT# ' truncates a string to a number of letters, similar to truncate_words ' #NEWLINE# s = force_unicode ( s ) #NEWLINE# length = int ( length ) #NEWLINE# if ( len ( s ) > length ) : #NEWLINE# #INDENT# s = s [ : length ] #NEWLINE# if ( not s . endswith ( '...' ) ) : #NEWLINE# #INDENT# s += '...' #NEWLINE# #UNINDENT# #UNINDENT# return s