def crop_title(title, length=None, suffix='...'):
 length = (flaskbb_config['TITLE_LENGTH'] if (length is None) else length)
 if (len(title) <= length):
  return title
 return (title[:length].rsplit(' ', 1)[0] + suffix)

def crop_title ( title , length = None , suffix = '...' ) : length = ( flaskbb_config [ 'TITLE_LENGTH' ] if ( length is None ) else length ) if ( len ( title ) <= length ) : return title return ( title [ : length ] . rsplit ( ' ' , 1 ) [ 0 ] + suffix )
crops the title to a specified length .