Ignore:
Timestamp:
Mar 20, 2018, 1:14:34 PM (18 months ago)
Author:
Juanma
Message:

External appimages file

Location:
lliurex-store/trunk/fuentes
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/appImageManager.py

    r7069 r7079  
    1919class appimagemanager:
    2020        def __init__(self):
    21                 self.dbg=False
     21                self.dbg=True
    2222                self.progress=0
    2323                self.partial_progress=0
     
    3535                self.repos={'probono':{'url':'https://dl.bintray.com/probono/AppImages', 'url_info':'https://bintray.com/probono/AppImages/$(appname)'}}
    3636                #Appimges not stored in a repo must be listed here, providing the download url and the info url (if there's any)
    37                 self.external_appimages={'synfig64':{'url':'https://kent.dl.sourceforge.net/project/synfig/releases/1.2.1/linux/SynfigStudio-1.2.1-64bit.appimage','url_info':''},'synfig32':{'url':'https://kent.dl.sourceforge.net/project/synfig/releases/1.2.1/linux/SynfigStudio-1.2.1-32bit.appimage','url_info':''}}
     37                self.external_appimages="/usr/share/lliurex-store/files/external_appimages.json"
    3838                self.disabled=False
    3939                self.count=0
     
    4747        def _debug(self,msg=''):
    4848                if self.dbg:
    49                         print ('DEBUG appimage: '+msg)
     49                        print ('DEBUG appimage: %s'%msg)
    5050        #def debug
    5151
     
    233233                                        self._debug("appImage catalogue could not be fetched: Permission denied")
    234234                #Load external apps
    235                 for app_name,app_info in self.external_appimages.items():
     235                for app_name,app_info in self._get_external_appimages().items():
    236236                        if self._chk_bundle_dir(outdir):
    237237                                appimage=app_info['url'].split('/')[-1]
     
    251251                return(True)
    252252        #def _download_bundles_catalogue
     253
     254        def _get_external_appimages(self):
     255                external_appimages={}
     256                if os.path.isfile(self.external_appimages):
     257                        try:
     258                                with open(self.external_appimages) as appimages:
     259                                        external_appimages=json.load(appimages)
     260                        except:
     261                                self._debug("Can't load %s"%self.external_appimages)
     262                self._debug(external_appimages)
     263                return external_appimages
    253264
    254265        def _chk_bundle_dir(self,outdir):
Note: See TracChangeset for help on using the changeset viewer.