Render a Text MessageElement as plain text.

        :returns: The plain text representation of the Text MessageElement.
        :rtype: basestring
5113
def to_text(self):
        
        if self.items is None:
            return
        else:
            text = ''
            for item in self.items:
                text += ' - %s\n' % item.to_text()

            return text
865017
def text(self):
        
        data = self.content
        return data.decode(self.encoding or 'utf-8') if data else ''
94959
def render(self, text, add_header=False):
        

        html = mark_text(text, self.aesthetics, self.rules)
        html = html.replace('\n', '<br/>')
        if add_header:
            html = '\n'.join([HEADER, self.css, MIDDLE, html, FOOTER])
        #print('\n'.join((HEADER, self.css, MIDDLE, html, FOOTER)))
        return html
1354193
def message(self):
        
        message = self.description.format(**self.parameters)
        return '{code} {message}'.format(code=self.code, message=message)
398679
def text(self):
        """"""
        # ---note this shadows lxml _Element.text---
        txBody = self.txBody
        if txBody is None:
            return ''
        return '\n'.join([p.text for p in txBody.p_lst])
628533
def to_s
      text = ''

      text << tag_output_string + "\n" unless tags.empty?
      text << "#{@keyword}:#{name_output_string}"
      text << "\n" + description_output_string unless (description.nil? || description.empty?)
      text << "\n" unless (rows.empty? || description.nil? || description.empty?)
      text << "\n" + parameters_output_string if parameter_row
      text << "\n" + rows_output_string unless argument_rows.empty?

      text
    end
1153636
def to_string(self):
        
        buff = u""
        for child in self.content.iter():
            if child.tag in [self.qn('text:p'), self.qn('text:h')]:
                buff += self.text_to_string(child) + "\n"
        # remove last newline char
        if buff:
            buff = buff[:-1]
        return buff
1099403
def elements_as_text(self, elems, indent=2):
        
        assert elems
        text = ""
        for elename, eledesc in elems.items():
            if isinstance(eledesc, dict):
                desc_txt = self.elements_as_text(eledesc, indent + 2)
                desc_txt = ''.join(['\n', desc_txt])
            elif isinstance(eledesc, str):
                desc_txt = ''.join([eledesc, '\n'])
            else:
                assert False, "Only string or dictionary"
            ele_txt = "\t{0}{1: <22} {2}".format(' ' * indent, elename,
                                                 desc_txt)
            text = ''.join([text, ele_txt])
        return text
1076481
def plaintext(self):
        
        text = self.text
        text = self.OVERRIDE_SEQUENCE.sub("", text)
        text = text.replace(r"\h", " ")
        text = text.replace(r"\n", "\n")
        text = text.replace(r"\N", "\n")
        return text
315689
def to_array(self):
        
        array = super(InputTextMessageContent, self).to_array()
        array['message_text'] = u(self.message_text)  # py2: type unicode, py3: type str
        if self.parse_mode is not None:
            array['parse_mode'] = u(self.parse_mode)  # py2: type unicode, py3: type str
        if self.disable_web_page_preview is not None:
            array['disable_web_page_preview'] = bool(self.disable_web_page_preview)  # type bool
        return array
657762
def to_html(self):
        

        text = self.text
        if text is None:
            text = self.uri
        return '<a href="%s"%s>%s</a>' % (
            self.uri, self.html_attributes(), text)
659482
def to_text(self):
        

        table = ''
        if self.caption is not None:
            table += '%s</caption>\n' % self.caption
        table += '\n'
        for row in self.rows:
            table += row.to_text()
        return table
317192
def text(self):
        
        if self.m_name == -1 or self.m_event != TEXT:
            return ''

        return self.sb[self.m_name]
1198192
def plain(self):
        
        s = []
        s.append(self.DECL)
        root = self.root()
        if root is not None:
            s.append(root.plain())
        return ''.join(s)
387796
def to_text(self):
        
        if self.text is None:
            return

        level = '*' * self.level
        return '%s%s\n' % (level, self.text)
187164
def _get_element_text(self, element):
        
        text = ''
        if element.text is not None:
            text += element.text
        for child in element.getchildren():
            text += self._get_element_text(child)
        if element.tail is not None:
            text += element.tail
        return text
27514
def content(self):
        
        # The code that follows is obviously pretty disgusting.
        # It seems like it might be impossible to completely replicate
        # the text of the original message if it has trailing whitespace
        message = self._content_xpb.one_(self._message_element)
        first_line = message.text
        if message.text[:2] == '  ':
            first_line = message.text[2:]
        else:
            log.debug("message did not have expected leading whitespace")
        subsequent_lines = ''.join([
            html.tostring(child, encoding='unicode').replace('<br>', '\n')
            for child in message.iterchildren()
        ])
        message_text = first_line + subsequent_lines
        if len(message_text) > 0 and message_text[-1] == ' ':
            message_text = message_text[:-1]
        else:
            log.debug("message did not have expected leading whitespace")

        return message_text