Changeset 3827 for lliurex-store


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

Refactorized is_action_running function

Location:
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore
Files:
2 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)
  • lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/storeManager.py

    r3826 r3827  
    418418
    419419                searchFunction=self._execute_class_method(action,'*',launchedby)
    420                 aux_result=searchFunction.execute_action(self.store,action,searchItem)
     420                if (launchedby=="install" or launchedby=='remove'):
     421                        #Last boolean parameter sets the exact_match_for_search attribute
     422                        aux_result=searchFunction.execute_action(self.store,action,searchItem,True)
     423                else:
     424                        aux_result=searchFunction.execute_action(self.store,action,searchItem,False)
    421425                aux_applist=aux_result['data']
    422426                status=aux_result['status']
Note: See TracChangeset for help on using the changeset viewer.