Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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(),
     }
Beispiel #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']
     }
Beispiel #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))
Beispiel #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))
Beispiel #8
0
 def _html_escape(self, item):
     return html_escape(item) if is_string(item) else item
Beispiel #9
0
 def _format_text(self, doc):
     return '<p style="white-space: pre-wrap">%s</p>' % html_escape(doc)
Beispiel #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())
Beispiel #11
0
 def _escape(self, item):
     return html_escape(item)
Beispiel #12
0
 def html_message(self):
     """Returns the message content as HTML."""
     return self.message if self.html else html_escape(self.message)
 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
Beispiel #15
0
 def _html_escape(self, message):
     if message.startswith('*HTML*'):
         return message[6:].lstrip()
     else:
         return html_escape(message)
Beispiel #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())
Beispiel #17
0
 def _format_text(self, doc):
     return '<p style="white-space: pre-wrap">%s</p>' % html_escape(doc)
 def _html_escape(self, item):
     return html_escape(item) if is_string(item) else item
Beispiel #19
0
 def _html_escape(self, message):
     if message.startswith('*HTML*'):
         return message[6:].lstrip()
     else:
         return html_escape(message)
Beispiel #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))