def elide(text, length):
 if (length < 1):
  raise ValueError('length must be >= 1!')
 if (len(text) <= length):
  return text
 else:
  return (text[:(length - 1)] + '\\u2026')

def elide ( text , length ) : if ( length < 1 ) : raise ValueError ( 'length must be >= 1!' ) if ( len ( text ) <= length ) : return text else : return ( text [ : ( length - 1 ) ] + '\\u2026' )
elide text so it uses a maximum of length chars .