Changeset 5215
- Timestamp:
- Jun 17, 2017, 12:19:51 AM (20 months ago)
- Location:
- lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/infoManager.py
r5199 r5215 60 60 appInfo=self._init_appInfo() 61 61 # self._debug("Gathering package info for "+app.get_id()) 62 appInfo['appstream_id']=app 62 63 if app.get_id(): 63 64 appInfo['id']=app.get_id() … … 168 169 169 170 def _init_appInfo(self): 170 appInfo={'id':'',\ 171 appInfo={'appstream_id':'',\ 172 'id':'',\ 171 173 'name':'',\ 172 174 'version':'',\ -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/searchManager.py
r5018 r5215 80 80 self._debug("App direct match found: "+app.get_id()) 81 81 if not exact_match: 82 applist=self._get_apps_by_match(tokens,applist) 82 applist.extend(self._get_apps_by_match(tokens,applist)) 83 # if len(applist): 84 # self._set_status(0) 85 # else: 86 applist.extend(self._get_app_by_pkgname(tokens,applist)) 87 applist=set(applist) 83 88 if len(applist): 84 89 self._set_status(0) 85 90 else: 86 applist=self._get_app_by_pkgname(tokens,applist) 87 if len(applist): 88 self._set_status(0) 89 else: 90 self._set_status(1) 91 self._set_status(1) 91 92 self.result['data']=applist 92 93 return(applist) … … 158 159 def _get_apps_by_match(self,tokens,applist=[]): 159 160 #Add items witch match >= self.precision 161 if not applist: 162 insertPosition=1 163 else: 164 insertPosition=len(applist)+1 160 165 apps_in_store=self.store.get_apps() 161 166 if apps_in_store: … … 170 175 score=app.search_matches(token) 171 176 if score>=self.precision: 177 if "appimage" in app.get_id().lower(): 178 score=1 172 179 if score in auxDict: 173 180 auxDict[score].append(app) … … 182 189 183 190 def _get_app_by_pkgname(self,tokens,applist=[]): 191 if not applist: 192 insertPosition=1 193 else: 194 insertPosition=len(applist)+1 184 195 apps_in_store=self.store.get_apps() 185 196 if apps_in_store: … … 192 203 for token in tokens: 193 204 if app.get_pkgname_default()==token: 194 applist. append(app)195 196 return(applist) 205 applist.insert(1,app) 206 207 return(applist) -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/storeManager.py
r5199 r5215 419 419 self._debug("Retrieving info for "+str(typeDict[package_type])) 420 420 pkgInfoFunction=self._execute_class_method(action,package_type,launchedby) 421 #result.update(pkgInfoFunction.execute_action(action,typeDict[package_type]))421 result.update(pkgInfoFunction.execute_action(action,typeDict[package_type])) 422 422 # result['data'].extend(pkgInfoFunction.execute_action(action,typeDict[package_type])['data']) 423 423 # result['status']=pkgInfoFunction.execute_action(action,typeDict[package_type])['status'] 424 result=pkgInfoFunction.execute_action(action,typeDict[package_type])424 # result=pkgInfoFunction.execute_action(action,typeDict[package_type]) 425 425 else: 426 426 result['data'].append(appInfo) … … 561 561 result=installFunction.execute_action(action,typeDict[package_type]) 562 562 self.result[action]=result 563 if result['status']['status']==0: 564 #Mark the apps as installed or available 565 for app in typeDict[package_type]: 566 if action=='install': 567 app['appstream_id'].set_state(1) 568 self._debug("App state changed to installed") 569 else: 570 app['appstream_id'].set_state(2) 571 self._debug("App state changed to available") 563 572 return_msg=True 564 self._debug("Regenerating the cache...")565 self._load_Store()573 # self._debug("Regenerating the cache...") 574 # self._load_Store() 566 575 self._log("Result "+action +": "+str(self.result[action])) 567 576 return(return_msg)
Note: See TracChangeset
for help on using the changeset viewer.