def s3_text_represent(text, truncate=True, lines=5, _class=None):
 if (not text):
  text = current.messages['NONE']
 if (_class is None):
  selector = '.text-body'
  _class = 'text-body'
 else:
  selector = ('.%s' % _class)
  _class = ('text-body %s' % _class)
 if truncate:
  s3_trunk8(selector=selector, lines=lines)
 return DIV(text, _class='text-body')

def s3_text_represent ( text , truncate = True , lines = 5 , _class = None ) : if ( not text ) : text = current . messages [ 'NONE' ] if ( _class is None ) : selector = '.text-body' _class = 'text-body' else : selector = ( '.%s' % _class ) _class = ( 'text-body %s' % _class ) if truncate : s3_trunk8 ( selector = selector , lines = lines ) return DIV ( text , _class = 'text-body' )
representation function for text fields with intelligent truncation and preserving whitespace .