def test_known_keyword(self):
     cell = CellInfo(CellContent(ContentType.USER_KEYWORD, 'Known', 'my_source'),
                     CellPosition(CellType.KEYWORD, None))
     msg = TipMessage(cell)
     assert_true(msg)
     assert_equal(str(msg),
                   html_escape(_TooltipMessage.KEYWORD % 'my_source'))
Пример #2
0
 def set_content(self, content, title=None, html=True):
     color = ''.join(hex(item)[2:] for item in POPUP_BACKGROUND)
     if not html:
         content = utils.html_escape(content, formatting=True)
     self._current_details = '<body bgcolor=#%s>%s</body>' % (color, content)
     self._details.SetPage(self._current_details)
     self._detached_title = title
Пример #3
0
 def test_known_keyword(self):
     cell = CellInfo(CellContent(ContentType.USER_KEYWORD, 'Known', 'my_source'),
                     CellPosition(CellType.KEYWORD, None))
     msg = TipMessage(cell)
     assert_true(msg)
     assert_equals(str(msg),
                   html_escape(_TooltipMessage.KEYWORD % 'my_source'))
Пример #4
0
 def details(self):
     return ('<table>'
             '<tr><td><i>Name:</i></td><td>%s</td></tr>'
             '<tr><td><i>Source:</i></td><td>%s &lt;%s&gt;</td></tr>'
             '<tr><td><i>Arguments:</i></td><td>%s</td></tr>'
             '</table>'
             '<table>'
             '<tr><td>%s</td></tr>'
             '</table>') % \
             (self._name(self.item), self._source(self.item), self._type,
              self._format_args(self._parse_args(self.item)),
              html_escape(self.doc, formatting=True))
Пример #5
0
def TipMessage(cell):
    if not cell:
        return ''
    tip = _TooltipMessage(cell) if not cell.for_loop \
        else _ForLoopTooltipMessage(cell)
    return html_escape(unicode(tip))
Пример #6
0
 def test_unknown_keyword(self):
     cell = CellInfo(CellContent(ContentType.STRING, 'What?'),
                     CellPosition(CellType.KEYWORD, None))
     msg = TipMessage(cell)
     assert_true(msg)
     assert_equals(str(msg), html_escape(_TooltipMessage.KEYWORD_NOT_FOUND))
Пример #7
0
def TipMessage(cell):
    if not cell:
        return ''
    tip = _TooltipMessage(cell) if not cell.for_loop \
        else _ForLoopTooltipMessage(cell)
    return html_escape(str(tip)).replace('\n', '<br />')
Пример #8
0
 def get_column_values(self, item):
     return [item.name, utils.html_escape(item.value), ListToStringFormatter(item.comment).value]
Пример #9
0
 def test_unknown_keyword(self):
     cell = CellInfo(CellContent(ContentType.STRING, 'What?'),
                     CellPosition(CellType.KEYWORD, None))
     msg = TipMessage(cell)
     assert_true(msg)
     assert_equals(str(msg), html_escape(_TooltipMessage.KEYWORD_NOT_FOUND))
Пример #10
0
 def get_column_values(self, item):
     return [
         item.name,
         utils.html_escape(item.value),
         ListToStringFormatter(item.comment).value
     ]
Пример #11
0
def TipMessage(cell):
    if not cell:
        return ""
    tip = _TooltipMessage(cell) if not cell.for_loop else _ForLoopTooltipMessage(cell)
    return html_escape(unicode(tip))
Пример #12
0
 def visible_value(self):
     return utils.html_escape(utils.unescape(self.value), formatting=True)