- Timestamp:
- Jun 19, 2017, 10:06:53 AM (4 years ago)
- 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/loadStore.py
r5217 r5218 277 277 self._th_generate_xml_catalog(applist,outdir,infoPage,repoType,progressBar) 278 278 self._debug("Fetched repo "+repo) 279 print (_("Removing old entries...")) 280 self._clean_bundle_catalogue(applist,outdir) 279 281 else: 280 282 print("permission denied") … … 304 306 applist.append(app.replace('"','')) 305 307 return(applist) 306 307 def _get_description(self,appName,infoPage):308 desc=''309 if '$(appname)' in infoPage:310 infoPage=infoPage.replace('$(appname)',appName)311 self._debug("Getting description from "+infoPage)312 try:313 with urllib.request.urlopen(infoPage) as f:314 content=(f.read().decode('utf-8'))315 soup=BeautifulSoup(content,"html.parser")316 descDiv=soup.findAll('div', attrs={ "class" : "description-text"})317 if len(descDiv)>0:318 desc=descDiv[0].text319 desc=desc.replace(':','.')320 desc=desc.replace('&','&')321 except Exception as e:322 print("Can't get description from "+infoPage)323 print(str(e))324 pass325 return(desc)326 308 327 309 def _th_generate_xml_catalog(self,applist,outdir,infoPage,repoType,progressBar=''): … … 356 338 version=nameSplitted[1] 357 339 arch=nameSplitted[2] 358 filename=outdir+name+"_"+version+".appdata.xml" 340 # filename=outdir+name+"_"+version+".appdata.xml" 341 filename=outdir+app.lower().replace('appimage',"appdata.xml") 359 342 self._debug("checking if we need to download "+filename) 360 343 if not os.path.isfile(filename): … … 401 384 self.progress=self.progress+inc 402 385 semaphore.release() 386 387 def _get_description(self,appName,infoPage): 388 desc='' 389 if '$(appname)' in infoPage: 390 infoPage=infoPage.replace('$(appname)',appName) 391 self._debug("Getting description from "+infoPage) 392 try: 393 with urllib.request.urlopen(infoPage) as f: 394 content=(f.read().decode('utf-8')) 395 soup=BeautifulSoup(content,"html.parser") 396 descDiv=soup.findAll('div', attrs={ "class" : "description-text"}) 397 if len(descDiv)>0: 398 desc=descDiv[0].text 399 desc=desc.replace(':','.') 400 desc=desc.replace('&','&') 401 except Exception as e: 402 print("Can't get description from "+infoPage) 403 print(str(e)) 404 pass 405 return(desc) 406 407 def _clean_bundle_catalogue(self,applist,outdir): 408 xmlList=[] 409 applist=[item.lower() for item in applist] 410 for xmlFile in os.listdir(outdir): 411 if xmlFile.endswith('appdata.xml'): 412 xmlList.append(xmlFile.lower().replace('appdata.xml','appimage')) 413 414 if xmlList: 415 discardList=list(set(xmlList).difference(applist)) 416 for discardFile in discardList: 417 os.remove(outdir+'/'+discardFile.replace('appimage','appdata.xml')) 418 #def _clean_appImg_repo 419 -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/storeManager.py
r5216 r5218 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]))422 #result['data'].extend(pkgInfoFunction.execute_action(action,typeDict[package_type])['data'])421 # result.update(pkgInfoFunction.execute_action(action,typeDict[package_type])) 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 424 # result=pkgInfoFunction.execute_action(action,typeDict[package_type])
Note: See TracChangeset
for help on using the changeset viewer.