controls/SearchResultPanel.py
changeset 2459 21164625b393
parent 2456 7373e3048167
child 2524 c80b0d864475
equal deleted inserted replaced
2458:2a70d5240300 2459:21164625b393
    22 # along with this program; if not, write to the Free Software
    22 # along with this program; if not, write to the Free Software
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    24 
    24 
    25 
    25 
    26 from __future__ import absolute_import
    26 from __future__ import absolute_import
    27 from types import TupleType
    27 from functools import reduce
    28 
    28 
    29 import wx
    29 import wx
    30 import wx.lib.buttons
    30 import wx.lib.buttons
    31 import wx.lib.agw.customtreectrl as CT
    31 import wx.lib.agw.customtreectrl as CT
    32 
    32 
   322             self.GenerateSearchResultsTreeBranch(item, child)
   322             self.GenerateSearchResultsTreeBranch(item, child)
   323             item, root_cookie = self.SearchResultsTree.GetNextChild(root, root_cookie)
   323             item, root_cookie = self.SearchResultsTree.GetNextChild(root, root_cookie)
   324 
   324 
   325     def ShowSearchResults(self, item):
   325     def ShowSearchResults(self, item):
   326         data = self.SearchResultsTree.GetPyData(item)
   326         data = self.SearchResultsTree.GetPyData(item)
   327         if isinstance(data, TupleType):
   327         if isinstance(data, tuple):
   328             search_results = [data]
   328             search_results = [data]
   329         else:
   329         else:
   330             search_results = self.SearchResults.get(data, [])
   330             search_results = self.SearchResults.get(data, [])
   331         self.ParentWindow.ClearHighlights(SEARCH_RESULT_HIGHLIGHT)
   331         self.ParentWindow.ClearHighlights(SEARCH_RESULT_HIGHLIGHT)
   332         for infos, start, end, _text in search_results:
   332         for infos, start, end, _text in search_results: