示例#1
0
文件: releases.py 项目: argp/aosd
 def get_display_name(cls, release_type):
     release_display_name = ''
     releases_dict_path = utilities.getreleaseplistpath()
     if os.path.exists(releases_dict_path) == True:
         releases_dict = plistlib.readPlist(releases_dict_path)
         type_results = list((item for item in releases_dict if item['package_name'] == release_type))
         if len(type_results) > 0:
             release_display_name = type_results[0]['display_name']
         else:
             logging_helper.getLogger().error('Could not find a version in the releases manifest file matching type "'+release_type+'". Please run the "update" command.')
     else:
         logging_helper.getLogger().error('Could not find the releases manifest file. Please run the "update" command.')
     return release_display_name
示例#2
0
文件: releases.py 项目: argp/aosd
 def get(cls):
     releases = []
     releases_dict_path = utilities.getreleaseplistpath()
     if os.path.exists(releases_dict_path) == True:
         releases_dict = plistlib.readPlist(releases_dict_path)
         releases_results = list(map(lambda release: release['package_name'], releases_dict))
         if len(releases_results) > 0:
             releases = releases_results
         else:
             logging_helper.getLogger().error('Could not find any release types in the releases manifest file. Please run the "update" command.')
     else:
         logging_helper.getLogger().error('Could not find the releases manifest file. Please run the "update" command.')
     return releases
示例#3
0
文件: update.py 项目: argp/aosd
    def fetch(cls):
        logging_helper.getLogger().info('Updating package data...')

        hashes_plist_url = os.path.join(config.getUpdateURL(), 'hashes.plist')
        hashes_plist_path = utilities.getlookupplistpath('hashes')
        manager.DownloadFileFromURLToPath(hashes_plist_url, hashes_plist_path)

        release_plist_url = os.path.join(config.getUpdateURL(), 'releases.plist')
        release_plist_path = utilities.getreleaseplistpath()
        manager.DownloadFileFromURLToPath(release_plist_url, release_plist_path)
        if os.path.exists(release_plist_path) == True:
            for release_type in releases.get():
                release_type_plist_url = os.path.join(config.getUpdateURL(), release_type+'.plist')
                release_type_plist_path = utilities.getlookupplistpath(release_type)
                manager.DownloadFileFromURLToPath(release_type_plist_url, release_type_plist_path)
示例#4
0
 def get_display_name(cls, release_type):
     release_display_name = ''
     releases_dict_path = utilities.getreleaseplistpath()
     if os.path.exists(releases_dict_path) == True:
         releases_dict = plistlib.readPlist(releases_dict_path)
         type_results = list((item for item in releases_dict
                              if item['package_name'] == release_type))
         if len(type_results) > 0:
             release_display_name = type_results[0]['display_name']
         else:
             logging_helper.getLogger().error(
                 'Could not find a version in the releases manifest file matching type "'
                 + release_type + '". Please run the "update" command.')
     else:
         logging_helper.getLogger().error(
             'Could not find the releases manifest file. Please run the "update" command.'
         )
     return release_display_name
示例#5
0
 def get(cls):
     releases = []
     releases_dict_path = utilities.getreleaseplistpath()
     if os.path.exists(releases_dict_path) == True:
         releases_dict = plistlib.readPlist(releases_dict_path)
         releases_results = list(
             map(lambda release: release['package_name'], releases_dict))
         if len(releases_results) > 0:
             releases = releases_results
         else:
             logging_helper.getLogger().error(
                 'Could not find any release types in the releases manifest file. Please run the "update" command.'
             )
     else:
         logging_helper.getLogger().error(
             'Could not find the releases manifest file. Please run the "update" command.'
         )
     return releases