Ignore:
Timestamp:
Mar 7, 2017, 1:07:33 PM (3 years ago)
Author:
Juanma
Message:

Refactorized is_action_running function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/searchManager.py

    r3678 r3827  
    3434                return(self.pluginInfo)
    3535
    36         def execute_action(self,appstreamStore,action,tokens):
     36        def execute_action(self,appstreamStore,action,tokens,exact_match_for_search=False):
    3737                if not type(tokens) is str:
    3838                        tokens=''
     
    5050                        self._list_sections()
    5151                if (action=='search' or action=='info'):
    52                         self._search_app(tokens)
     52                        self._search_app(tokens,exact_match_for_search)
    5353                self.progress=100
    5454                return(self.result)
     
    6060                self.precision=precision
    6161
    62         def _search_app(self,tokens):
    63                 self._debug("Searching app "+str(tokens))
     62        def _search_app(self,tokens,exact_match):
     63                self._debug("Searching app "+str(tokens)+ "with exact_match="+str(exact_match))
    6464                applist=[]
    6565                app=None
     
    7070                        applist.append(app)
    7171                        self._debug("App direct match found: "+app.get_id())
    72 #               else:
    73 #               for app in self._get_apps_by_match(tokens):
    74 #                       applist.append(app)
    75                 applist=self._get_apps_by_match(tokens,applist)
     72                if not exact_match:
     73                        applist=self._get_apps_by_match(tokens,applist)
    7674                if len(applist):
    7775                        self._set_status(0)
Note: See TracChangeset for help on using the changeset viewer.