Changeset 4363 for lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/storeManager.py
- Timestamp:
- Apr 20, 2017, 1:48:50 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/storeManager.py
r4108 r4363 96 96 syslog.openlog('lliurex-store') 97 97 syslog.syslog(msg) 98 self._debug(msg) 98 99 #### 99 100 #dict of actions/related functions for threading … … 294 295 for res in self.result.keys(): 295 296 if res!='load': 296 result[res]=self.result[res]['data'] 297 if 'data' in self.result[res]: 298 result[res]=self.result[res]['data'] 299 else: 300 result[res]=[] 297 301 else: 298 302 self._debug("Checking result for action "+action) … … 301 305 result[action]=None 302 306 if action in self.result: 303 result[action]=self.result[action]['data'] 307 if 'data' in self.result[action]: 308 result[action]=self.result[action]['data'] 309 else: 310 result[action]=[] 304 311 self.lock.release() 305 312 return(result) … … 315 322 def get_status(self,action=None): 316 323 self.lock.acquire() 317 324 self._debug("Checking status for action "+str(action)) 318 325 result={} 319 326 if action in self.result: … … 364 371 action='pkginfo' 365 372 typeDict={} 366 result=[] 373 result={} 374 result['data']=[] 375 result['status']={'status':0,'msg':''} 367 376 for appInfo in applistInfo: 368 377 package_type=self._check_package_type(appInfo) … … 374 383 self._debug("Checking plugin for "+action+ " "+package_type) 375 384 if package_type in self.registeredPlugins[action]: 376 #Only search deb'sfull info if it's required377 if ( package_type=='deb' andfullsearch==False):378 result =result+typeDict[package_type]385 #Only search full info if it's required 386 if (fullsearch==False): 387 result['data'].extend(typeDict[package_type]) 379 388 continue 380 389 self._debug("Retrieving info for "+str(typeDict[package_type])) 381 390 pkgInfoFunction=self._execute_class_method(action,package_type,launchedby) 382 result =result+pkgInfoFunction.execute_action(action,typeDict[package_type])['data']391 result.update(pkgInfoFunction.execute_action(action,typeDict[package_type])) 383 392 return(result) 384 393 #def _get_Extended_App_Info … … 430 439 exact_match=False 431 440 searchFunction=self._execute_class_method(action,'*',launchedby) 432 aux_result=searchFunction.execute_action(self.store,action,searchItem,exact_match)433 aux_applist= aux_result['data']434 status= aux_result['status']441 result=searchFunction.execute_action(self.store,action,searchItem,exact_match) 442 aux_applist=result['data'] 443 status=result['status'] 435 444 realAction=action 436 445 if status['status']==0: … … 438 447 partialAction='get_info' 439 448 self.result[partialAction]={} 440 applist=self._get_App_Info(aux_applist,launchedby)449 result=self._get_App_Info(aux_applist,launchedby) 441 450 self._debug("Add result for "+partialAction) 442 self.result[partialAction] ['data']=applist451 self.result[partialAction]=result 443 452 #2.- Get rest of metadata (slower) 444 453 partialAction='pkginfo' 445 applist=self._get_Extended_App_Info(applist,launchedby,fullsearch)454 result=self._get_Extended_App_Info(result['data'],launchedby,fullsearch) 446 455 if launchedby: 447 456 realAction=launchedby 448 457 self._debug("Assigned results of "+action+" to "+realAction) 449 if ( len(applist)):458 if (result['status']['status']==0) or (result['status']['status']==9): 450 459 return_msg=True 460 if fullsearch: 461 result['status']['status']=0 451 462 else: 452 463 return_msg=False 453 464 else: 454 465 return_msg=False 455 self.result[launchedby]['data']= applist456 self.result[launchedby]['status']= status466 self.result[launchedby]['data']=result['data'] 467 self.result[launchedby]['status']=result['status'] 457 468 return(return_msg) 458 469 #def _search_Store … … 466 477 #### 467 478 def _install_remove_App(self,appName,action='install',launchedby=None): 468 self._debug("Attempting to "+action +" "+appName)469 479 self._log("Attempting to "+action +" "+appName) 470 480 result={}
Note: See TracChangeset
for help on using the changeset viewer.