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