Changeset 7721
- Timestamp:
- Jul 16, 2018, 12:22:51 PM (17 months ago)
- Location:
- lliurex-store/trunk/fuentes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/debian/changelog
r7641 r7721 1 lliurex-store (0.5.7) xenial; urgency=medium 2 3 * Availabe snaps are loaded from available sections and not from wilcard 4 5 -- Juanma Navarro Mañez <juanma1980@gmail.com> Mon, 16 Jul 2018 12:21:53 +0200 6 1 7 lliurex-store (0.5.6.5) xenial; urgency=high 2 8 -
lliurex-store/trunk/fuentes/install-files/usr/share/lliurex-store/files/external_appimages.json
r7079 r7721 1 1 { 2 " synfig64":2 "Krita": 3 3 { 4 "url":"https://kent.dl.sourceforge.net/project/synfig/releases/1.2.1/linux/SynfigStudio-1.2.1-64bit.appimage", 5 "url_info":"" 4 "url":"http://download.kde.org/stable/krita/4.1.0/krita-4.1.0-x86_64.appimage", 5 "version":"4.1.0", 6 "description":{"es":"Krita es un programa profesional de pintura digital, gratuito y hecho con código libre, ha sido creado por artistas mismos que desean hacer éstas herramientas accesibles para todos", 7 "C":"Krita is a professional FREE and open source painting program. It is made by artists that want to see affordable art tools for everyone", 8 "ca":"Krita és un programa professional de pintura digital, gratuït i fet amb codi lliure, ha estat creat per artistes mateixos que volen fer aquestes eines accessibles a tothom" 9 }, 10 "name":"Krita", 11 "url_info":"", 12 "keywords":["krita","digital","paint","pintura","dibujo","dibuix","graphics"], 13 "homepage":"https://krita.org", 14 "categories":["appimage","QT","KDE","Graphics"] 6 15 }, 7 " synfig32":16 "gmic-krita": 8 17 { 9 "url":"https://kent.dl.sourceforge.net/project/synfig/releases/1.2.1/linux/SynfigStudio-1.2.1-32bit.appimage", 10 "url_info":"" 18 "url":"http://download.kde.org/stable/krita/4.1/gmic_krita_qt-x86_64.appimage", 19 "name":"Gmic-Krita", 20 "version":"2.3.3", 21 "url_info":"", 22 "description":{"C":"G'MIC is a full-featured open-source framework for image processing, distributed under the CeCILL free software licenses (LGPL-like and/or GPL-compatible). It provides several different user interfaces to convert / manipulate / filter / visualize generic image datasets, ranging from 1d scalar signals to 3d+t sequences of multi-spectral volumetric images, hence including 2d color images."}, 23 "keywords":["krita","gimp","paint","painting","dibujo","dibuix","graphics","gmic"], 24 "homepage":"https://gmic.eu/", 25 "categories":["appimage","Graphics"] 11 26 } 12 27 } -
lliurex-store/trunk/fuentes/lliurex-store-gui/usr/share/lliurex-store/lliurex-store-gui/DetailsBox.py
r7440 r7721 521 521 if os.path.exists("/snap/bin/%s"%snap): 522 522 Popen(["/snap/bin/%s"%snap]) 523 elif self.core.main_window.current_pkg[" name"].endswith('.appimage'):524 appimg=self.core.main_window.current_pkg[" name"].lower()523 elif self.core.main_window.current_pkg["package"].endswith('.appimage'): 524 appimg=self.core.main_window.current_pkg["package"].lower() 525 525 if os.path.exists(os.getenv("HOME")+"/.local/bin/%s"%appimg): 526 526 Popen([os.getenv("HOME")+"/.local/bin/%s"%appimg]) -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/appImageManager.py
r7433 r7721 32 32 self.bundles_dir=self.cache_dir+"/xmls/appimage" 33 33 self.bundle_types=['appimg'] 34 # self.appimage_dir=os.getenv("HOME")+"/.lliurex-store/appimg"35 34 self.appimage_dir=os.getenv("HOME")+"/.local/bin" 36 #To get the description of an app we must go to a specific url defined in url_info.37 #$(appname) we'll be replaced with the appname so the url matches the right one.38 #If other site has other url naming convention it'll be mandatory to define it with the appropiate replacements39 35 self.repos={'appimagehub':{'type':'json','url':'https://appimage.github.io/feed.json','url_info':''}} 40 #Appim ges not stored in a repo must be listed in this file, providing the download url and the info url (if there's any)36 #Appimages not stored in a repo must be listed in this file, providing at least the download url 41 37 self.external_appimages="/usr/share/lliurex-store/files/external_appimages.json" 42 38 self.locale=['ca_ES@valencia','ca@valencia','qcv','ca','ca_ES','es_ES','es','en_US','en_GB','en','C'] … … 81 77 if action=='load': 82 78 self._load_appimage_store() 83 # self.result['data']=self._load_appimage_store()84 79 #wait till threads end (if any) 85 80 self._debug("Ending threads...") 86 # for app in self.apps_for_store:87 81 for th in threading.enumerate(): 88 82 if th.is_alive(): … … 141 135 self._set_status(4) 142 136 else: 143 # appimage_url=app_info['installerUrl']+'/'+app_info['package'] 144 appimage_url=app_info['channel_releases']['appimage'][0]137 if 'appimage' in app_info['channel_releases'].keys(): 138 appimage_url=app_info['channel_releases']['appimage'][0] 145 139 self._debug("Downloading "+appimage_url) 146 140 dest_path=self.appimage_dir+'/'+app_info['package'] … … 151 145 bf=16*1024 152 146 acumbf=0 153 # print("Response: %s"%response.info())154 147 app_size=int(response.info()['Content-Length']) 155 # print("APP SIZE: %s"%app_size)156 148 while True: 157 149 if acumbf>=app_size: … … 188 180 def _load_appimage_store(self,store=None): 189 181 self._get_bundles_catalogue() 182 self._get_external_catalogue() 190 183 if os.path.exists(self.bundles_dir): 191 184 for bundle_type in self.bundle_types: … … 231 224 self._th_generate_xml_catalog(applist,outdir,repo_info['url_info'],repo_info['url'],repo_name) 232 225 all_apps.extend(applist) 226 return True 227 #def _get_bundles_catalogue 228 229 def _get_external_catalogue(self): 230 applist=[] 231 all_apps=[] 232 outdir=self.bundles_dir+'/appimg/' 233 233 #Load external apps 234 234 for app_name,app_info in self._get_external_appimages().items(): 235 235 if os.path.isdir(self.bundles_dir): 236 236 appinfo=self._init_appinfo() 237 appinfo['name']=app_info['url'].split('/')[-1] 237 if 'name' in app_info.keys(): 238 appinfo['name']=app_info['name'] 239 else: 240 appinfo['name']=app_info['url'].split('/')[-1] 238 241 appinfo['package']=app_info['url'].split('/')[-1] 239 appinfo['homepage']='/'.join(app_info['url'].split('/')[0:-1]) 242 if 'homepage' in app_info.keys(): 243 appinfo['homepage']=app_info['homepage'] 244 else: 245 appinfo['homepage']='/'.join(app_info['url'].split('/')[0:-1]) 246 appinfo['installerUrl']=app_info['url'] 247 if 'description' in app_info.keys(): 248 if type(app_info['description'])==type({}): 249 for lang in app_info['description']: 250 appinfo['description'].update({lang:app_info['description'][lang]}) 251 else: 252 appinfo['description'].update({"C":appimage['description']}) 253 if 'categories' in app_info.keys(): 254 appinfo['categories']=app_info['categories'] 255 if 'keywords' in app_info.keys(): 256 appinfo['keywords']=app_info['keywords'] 257 if 'version' in app_info.keys(): 258 appinfo['version']=app_info['version'] 240 259 self._debug("Fetching external appimage %s"%app_info['url']) 241 260 appinfo['bundle']='appimage' 242 applist=[appinfo] 243 self._th_generate_xml_catalog(applist,outdir,app_info['url_info'],app_info['url'],app_name) 244 self._debug("Fetched appimage "+app_info['url']) 245 all_apps.extend(applist) 261 self._debug("External:\n%s\n-------"%appinfo) 262 applist.append(appinfo) 246 263 else: 247 264 self._debug("External appImage could not be fetched: Permission denied") 265 self._th_generate_xml_catalog(applist,outdir,app_info['url_info'],app_info['url'],app_name) 266 self._debug("Fetched appimage "+app_info['url']) 267 all_apps.extend(applist) 248 268 self._debug("Removing old entries...") 249 269 # self._clean_bundle_catalogue(all_apps,outdir) 250 270 return(True) 251 #def _get_ bundles_catalogue271 #def _get_external_catalogue 252 272 253 273 def _fetch_repo(self,repo): … … 267 287 except: 268 288 self._debug("Can't load %s"%self.external_appimages) 269 self._debug(external_appimages)270 289 return external_appimages 271 290 #def _get_external_appimages … … 288 307 if appimage['links']: 289 308 appinfo=self.load_json_appinfo(appimage) 290 #Deprecated. appImage releases will be load on the info stage291 # releases=self._get_releases_from_json(appimage)292 # if releases:293 # appinfo['releases']=releases294 # for release in releases:295 # #Release has the direct download url296 # tmp_release=release.split('/')297 # tmp_appinfo=appinfo.copy()298 # rel_number=tmp_release[-2]299 # rel_name=tmp_release[-1].lower().replace('.appimage','')300 # self._debug("Release: %s"%release)301 # tmp_appinfo['name']=rel_name302 # tmp_appinfo['package']=tmp_release[-1]303 # tmp_appinfo['homepage']='/'.join(tmp_release[0:-1])304 # self.queue.put(tmp_appinfo)305 309 return(appinfo) 306 310 #def _th_process_appimage … … 314 318 appinfo['summary']='' 315 319 if 'description' in appimage.keys(): 316 appinfo['description']=appimage['description'] 320 if type(appinfo['description'])==type({}): 321 for lang in appinfo['description'].keys(): 322 appinfo['description'].update({lang:appimage['description'][lang]}) 323 else: 324 appinfo['description']={"C":appimage['description']} 317 325 if 'categories' in appimage.keys(): 318 326 appinfo['categories']=appimage['categories'] … … 361 369 #def _th_write_xml 362 370 363 # def _add_appimage(self,appinfo,repo_info):364 371 def _add_appimage(self,appinfo): 365 372 #Search in local store for the app … … 374 381 else: 375 382 self._debug("Generating new %s"%appinfo['package']) 376 app.set_id("appimagehub.%s"%appinfo['name'].lower()+'.appimage') 383 if appinfo['name'].endswith('.appimage'): 384 app.set_id("appimagehub.%s"%appinfo['name'].lower()) 385 app.set_name("C",appinfo['name']) 386 else: 387 app.set_id("appimagehub.%s"%appinfo['name'].lower()+'.appimage') 388 app.set_name("C",appinfo['name']+".appimage") 389 if appinfo['package'].endswith('.appimage'): 390 app.add_pkgname(appinfo['package'].lower()) 391 else: 392 app.add_pkgname(appinfo['package'].lower()+".appimage") 377 393 app.set_id_kind=appstream.IdKind.DESKTOP 378 394 sw_new=True … … 380 396 icon=appstream.Icon() 381 397 screenshot=appstream.Screenshot() 382 app.set_name("C",appinfo['name']+".appimage")383 app.add_pkgname(appinfo['package'].lower()+".appimage")384 398 if appinfo['license']: 385 399 app.set_project_license(appinfo['license']) 386 400 bundle=appstream.Bundle() 387 401 bundle.set_kind(bundle.kind_from_string('APPIMAGE')) 388 bundle.set_id(appinfo['package']+'.appimage') 389 # if app_orig: 390 # app_orig.add_bundle(bundle) 402 if appinfo['package'].endswith('.appimage'): 403 bundle.set_id(appinfo['package']) 404 else: 405 bundle.set_id(appinfo['package']+'.appimage') 391 406 app.add_bundle(bundle) 392 app.add_keyword("C","appimage") 393 app.add_category("appimage") 407 if 'keywords' in appinfo.keys(): 408 for keyword in appinfo['keywords']: 409 app.add_keyword("C",keyword) 410 if 'appimage' not in appinfo['keywords']: 411 app.add_keyword("C","appimage") 412 else: 413 app.add_keyword("C","appimage") 394 414 app.add_url(appstream.UrlKind.UNKNOWN,appinfo['installerUrl']) 395 415 app.add_url(appstream.UrlKind.HOMEPAGE,appinfo['homepage']) 396 416 if sw_new: 397 417 app.add_keyword("C",appinfo['package']) 398 app.set_name("C",appinfo['name']+".appimage") 399 description="This is an AppImage bundle of app %s. It hasn't been tested by our developers and comes from a 3rd party dev team. Please use it carefully.\n%s"%(appinfo['name'],appinfo['description']) 400 summary=' '.join(list(description.split(' ')[:8])) 401 if len(description.split(' '))>8: 402 summary+="... " 403 app.set_description("C",description) 404 app.set_comment("C",summary) 405 for category in appinfo['categories']: 406 app.add_category(category) 418 if not appinfo['name'].endswith('.appimage'): 419 app.set_name("C",appinfo['name']+".appimage") 420 for lang,desc in appinfo['description'].items(): 421 description="This is an AppImage bundle of app %s. It hasn't been tested by our developers and comes from a 3rd party dev team. Please use it carefully.\n%s"%(appinfo['name'],desc) 422 summary=' '.join(list(description.split(' ')[:8])) 423 if len(description.split(' '))>8: 424 summary+="... " 425 app.set_description(lang,description) 426 app.set_comment(lang,summary) 427 if 'categories' in appinfo.keys(): 428 for category in appinfo['categories']: 429 app.add_category(category) 430 if 'appimage' not in appinfo['categories']: 431 app.add_category("appimage") 432 else: 433 app.add_category("appimage") 407 434 if appinfo['icon']: 408 435 if self.icon_cache_enabled: … … 424 451 app.add_screenshot(screenshot) 425 452 #Adds the app to the store 426 # self._debug("Adding %s"%appinfo['package'])427 453 self.apps_for_store.put(app) 428 454 if not os.path.isfile(self.bundles_dir+'/'+app.get_id_filename()): … … 463 489 464 490 def _download_file(self,url,app_name,dest_dir): 465 # target_file=self.icons_folder+'/'+app_name+".png"466 491 target_file=dest_dir+'/'+app_name+".png" 467 492 if not url.startswith('http'): 468 493 url="https://appimage.github.io/database/%s"%url 469 494 if not os.path.isfile(target_file): 470 # shutil.copy("/usr/share/icons/hicolor/128x128/apps/lliurex-store.png",target_file)471 # if not os.fork():472 495 if not os.path.isfile(target_file): 473 496 self._debug("Downloading %s to %s"%(url,target_file)) … … 487 510 self._debug("Reason: %s"%e) 488 511 target_file='' 489 # os._exit(0)490 512 return(target_file) 491 513 #def _download_file … … 512 534 'license':'',\ 513 535 'summary':'',\ 514 'description': '',\536 'description':{},\ 515 537 'categories':[],\ 516 538 'icon':'',\ … … 534 556 def _get_info(self,app_info): 535 557 if app_info['installerUrl']: 558 self._debug("installer: %s"%app_info['installerUrl']) 536 559 app_info['channel_releases']={'appimage':[]} 537 560 app_info['channel_releases']['appimage']=self._get_releases(app_info) … … 554 577 #Version (unaccurate aprox) 555 578 app_info['version']=app_info['channel_releases']['appimage'][0].split('/')[-2] 556 # try:557 # app_info['version']="%s.%s"%(version.split('.')[1],version.split('.')[2])558 # except:559 # app_info['version']="%s"%version.split('_')[-1]560 579 561 580 self._set_status(0) … … 577 596 releases_page="" 578 597 url_source="opensuse" 579 # app_info['installerUrl']=app_info['installerUrl']+"/download" 580 581 with urllib.request.urlopen(app_info['installerUrl']) as f: 582 content=(f.read().decode('utf-8')) 583 soup=BeautifulSoup(content,"html.parser") 584 package_a=soup.findAll('a', attrs={ "href" : re.compile(r'.*\.[aA]pp[iI]mage$')}) 585 586 for package_data in package_a: 587 if url_source=="opensuse": 588 package_name=package_data.findAll('a', attrs={"class" : "mirrorbrain-btn"}) 589 else: 590 package_name=package_data.findAll('strong', attrs={ "class" : "pl-1"}) 591 package_link=package_data['href'] 592 if releases_page or url_source: 598 599 if url_source or releases_page: 600 with urllib.request.urlopen(app_info['installerUrl']) as f: 601 content=(f.read().decode('utf-8')) 602 soup=BeautifulSoup(content,"html.parser") 603 package_a=soup.findAll('a', attrs={ "href" : re.compile(r'.*\.[aA]pp[iI]mage$')}) 604 605 for package_data in package_a: 606 if url_source=="opensuse": 607 package_name=package_data.findAll('a', attrs={"class" : "mirrorbrain-btn"}) 608 else: 609 package_name=package_data.findAll('strong', attrs={ "class" : "pl-1"}) 610 package_link=package_data['href'] 593 611 package_link=releases_page+package_link 594 612 releases.append(package_link) 595 613 self._debug("Link: %s"%package_link) 614 else: 615 releases=[app_info['installerUrl']] 596 616 except Exception as e: 597 617 print(e) 618 self._debug(releases) 598 619 return releases 599 620 #def _get_releases -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/snapManager.py
r7433 r7721 134 134 fcache.write(str(int(time.time()))) 135 135 if self.cli_mode: 136 pkgs=self._search_snap("*") 137 else: 138 pkgs=self._search_snap_async("*") 136 # pkgs=self._search_snap("*") 137 pkgs=self._load_sections() 138 else: 139 pkgs=self._load_sections() 140 # pkgs=self._search_snap_async("*") 139 141 self._set_status(1) 140 142 for pkg in pkgs: … … 238 240 wrap=request 239 241 242 def _load_sections(self): 243 sections=self.snap_client.get_sections_sync() 244 stable_pkgs=[] 245 for section in sections: 246 apps=self.snap_client.find_section_sync(Snapd.FindFlags.MATCH_NAME,section,None) 247 for pkg in apps: 248 stable_pkgs.append(pkg) 249 return(stable_pkgs) 250 240 251 def _search_snap_async(self,tokens): 241 252 self._debug("Async Searching %s"%tokens) … … 265 276 pkgs=None 266 277 try: 267 278 # pkgs,curr=self.snap_client.find_sync(Snapd.FindFlags.MATCH_NAME,tokens,None) 268 279 pkgs=self.snap_client.find_sync(Snapd.FindFlags.MATCH_NAME,tokens,None) 269 280 except Exception as e:
Note: See TracChangeset
for help on using the changeset viewer.