Exemplo n.º 1
0
 def _format_message_with_teardown_message(self, message):
     teardown = self.failure.teardown
     if teardown.startswith('*HTML*'):
         teardown = teardown[6:].lstrip()
         if not message.startswith('*HTML*'):
             message = '*HTML* ' + html_escape(message)
     elif message.startswith('*HTML*'):
         teardown = html_escape(teardown)
     return self.also_teardown_message % (message, teardown)
Exemplo n.º 2
0
 def _format_html_messages(self, messages):
     from robotide.lib.robot.utils import html_escape
     for msg in messages:
         if msg.startswith('*HTML*'):
             yield msg[6:].lstrip()
         else:
             yield html_escape(msg)
Exemplo n.º 3
0
 def _format_html_messages(self, messages):
     from robotide.lib.robot.utils import html_escape
     for msg in messages:
         if msg.startswith('*HTML*'):
             yield msg[6:].lstrip()
         else:
             yield html_escape(msg)
Exemplo n.º 4
0
 def report_config(self):
     if not self.report:
         return {}
     return {
         'title': html_escape(self['ReportTitle'] or ''),
         'logURL': self._url_from_path(self.report, self.log),
         'background' : self._resolve_background_colors(),
     }
Exemplo n.º 5
0
 def log_config(self):
     if not self.log:
         return {}
     return {
         'title': html_escape(self['LogTitle'] or ''),
         'reportURL': self._url_from_path(self.log, self.report),
         'splitLogBase': os.path.basename(os.path.splitext(self.log)[0]),
         'defaultLevel': self['VisibleLogLevel']
     }
Exemplo n.º 6
0
 def _create_label(self, message):
     # JLabel doesn't support multiline text, setting size, or wrapping.
     # Need to handle all that ourselves. Feels like 2005...
     wrapper = textwrap.TextWrapper(MAX_CHARS_PER_LINE,
                                    drop_whitespace=False)
     lines = []
     for line in html_escape(message, linkify=False).splitlines():
         if line:
             lines.extend(wrapper.wrap(line))
         else:
             lines.append('')
     return JLabel('<html>%s</html>' % '<br>'.join(lines))
Exemplo n.º 7
0
 def _create_label(self, message):
     # JLabel doesn't support multiline text, setting size, or wrapping.
     # Need to handle all that ourselves. Feels like 2005...
     wrapper = textwrap.TextWrapper(MAX_CHARS_PER_LINE,
                                    drop_whitespace=False)
     lines = []
     for line in html_escape(message, linkify=False).splitlines():
         if line:
             lines.extend(wrapper.wrap(line))
         else:
             lines.append('')
     return JLabel('<html>%s</html>' % '<br>'.join(lines))
Exemplo n.º 8
0
 def _html_escape(self, item):
     return html_escape(item) if is_string(item) else item
Exemplo n.º 9
0
 def _format_text(self, doc):
     return '<p style="white-space: pre-wrap">%s</p>' % html_escape(doc)
Exemplo n.º 10
0
 def _escape_and_encode_targets(self, targets):
     return NormalizedDict(
         (html_escape(key), self._encode_uri_component(value))
         for key, value in targets.items())
Exemplo n.º 11
0
 def _escape(self, item):
     return html_escape(item)
Exemplo n.º 12
0
 def html_message(self):
     """Returns the message content as HTML."""
     return self.message if self.html else html_escape(self.message)
Exemplo n.º 13
0
 def _escape(self, item):
     return html_escape(item)
 def __init__(self, content='', attributes=None, tag='td', escape=True):
     if escape:
         content = utils.html_escape(content)
     self.content = self._replace_newlines(content)
     self.attributes = attributes or {}
     self.tag = tag
Exemplo n.º 15
0
 def _html_escape(self, message):
     if message.startswith('*HTML*'):
         return message[6:].lstrip()
     else:
         return html_escape(message)
Exemplo n.º 16
0
 def _escape_and_encode_targets(self, targets):
     return NormalizedDict((html_escape(key), self._encode_uri_component(value))
                           for key, value in targets.items())
Exemplo n.º 17
0
 def _format_text(self, doc):
     return '<p style="white-space: pre-wrap">%s</p>' % html_escape(doc)
Exemplo n.º 18
0
 def _html_escape(self, item):
     return html_escape(item) if is_string(item) else item
Exemplo n.º 19
0
 def _html_escape(self, message):
     if message.startswith('*HTML*'):
         return message[6:].lstrip()
     else:
         return html_escape(message)
Exemplo n.º 20
0
 def html_message(self):
     """Returns the message content as HTML."""
     return self.message if self.html else html_escape(self.message)
 def _link_from_name(self, name, type_):
     return '<a name="%s_%s">%s</a>' % (type_, utils.attribute_escape(name),
                                        utils.html_escape(name))