(self, highlight)
Add highlight

            highlight = Highlight('what', addr, len)

            Raises 'HighlightExistsError' if an highlight at given Address exists
Add highlight
Add highlight
def add_highlight(self, highlight):
        """ Add highlight

            highlight = Highlight('what', addr, len)

            Raises 'HighlightExistsError' if an highlight at given Address exists
        """
        is_highlight = self.is_highlighted(highlight.offset)

        # no highlight exists add one
        # is given highlight is a temp highlight its added too (autoremoved later anyway)
        if not is_highlight or highlight.what == 'changed' or highlight.what == 'attention':
            self._highlights.append(highlight)
        else:
            error_msg = ('Existing Highlight at 0x{0:x} type {1}'.format(
                highlight.offset, is_highlight))
            raise HighlightExistsError(error_msg)

        self.viewChanged.emit()
        self.viewport().update()
        if highlight.what == 'changed' or highlight.what == 'attention':
            self._highlight_timer.start()
def add_highlight ( self , highlight ) : is_highlight = self . is_highlighted ( highlight . offset ) # no highlight exists add one # is given highlight is a temp highlight its added too (autoremoved later anyway) if not is_highlight or highlight . what == 'changed' or highlight . what == 'attention' : self . _highlights . append ( highlight ) else : error_msg = ( 'Existing Highlight at 0x{0:x} type {1}' . format ( highlight . offset , is_highlight ) ) raise HighlightExistsError ( error_msg ) self . viewChanged . emit ( ) self . viewport ( ) . update ( ) if highlight . what == 'changed' or highlight . what == 'attention' : self . _highlight_timer . start ( )