Beispiel #1
0
 def _render_item(self, col, cell, model, itr):
     (lang, histitem) = model.get_value(itr, 0)
     if self.__matchtext:
         idx = histitem.find(self.__matchtext)
         if idx >= 0:
             markup = markup_for_match(histitem, idx, idx+len(self.__matchtext))
             cell.set_property('markup', markup)
             return
     cell.set_property('text', histitem)
Beispiel #2
0
 def _markup_search(self, text, searchq, text_lower=None, searchq_lower=None):
     if text_lower is not None:
         idx = text_lower.find(searchq_lower)
     else:
         idx = text.find(searchq)
     if idx >= 0:
         return markup_for_match(text, idx, idx+len(searchq))
     else:
         return None          
Beispiel #3
0
 def _render_item(self, col, cell, model, itr):
     (lang, histitem) = model.get_value(itr, 0)
     if self.__matchtext:
         idx = histitem.find(self.__matchtext)
         if idx >= 0:
             markup = markup_for_match(histitem, idx,
                                       idx + len(self.__matchtext))
             cell.set_property('markup', markup)
             return
     cell.set_property('text', histitem)
Beispiel #4
0
 def _markup_search(self,
                    text,
                    searchq,
                    text_lower=None,
                    searchq_lower=None):
     if text_lower is not None:
         idx = text_lower.find(searchq_lower)
     else:
         idx = text.find(searchq)
     if idx >= 0:
         return markup_for_match(text, idx, idx + len(searchq))
     else:
         return None
 def _render_match(self, col, cell, model, iter):
     obj = model.get_value(iter, 0)
     matchmarkup = markup_for_match(obj.line, obj.match_start, obj.match_end)
     cell.set_property('markup', matchmarkup)