def platforms_to_releases(info, debug):
 output = []
 temp_releases = {}
 platforms = info.get('platforms')
 for platform in platforms:
  for release in platforms[platform]:
   key = ('%s-%s' % (release['version'], release['url']))
   if (key not in temp_releases):
    temp_releases[key] = {'sublime_text': '<3000', 'version': release['version'], 'date': info.get('last_modified', '2011-08-01 00:00:00'), 'url': update_url(release['url'], debug), 'platforms': []}
   if (platform == '*'):
    temp_releases[key]['platforms'] = ['*']
   elif (temp_releases[key]['platforms'] != ['*']):
    temp_releases[key]['platforms'].append(platform)
 for key in temp_releases:
  release = temp_releases[key]
  if (release['platforms'] == ['windows', 'linux', 'osx']):
   release['platforms'] = ['*']
  output.append(release)
 return output

def platforms_to_releases ( info , debug ) : output = [ ] temp_releases = { } platforms = info . get ( 'platforms' ) for platform in platforms : for release in platforms [ platform ] : key = ( '%s-%s' % ( release [ 'version' ] , release [ 'url' ] ) ) if ( key not in temp_releases ) : temp_releases [ key ] = { 'sublime_text' : '<3000' , 'version' : release [ 'version' ] , 'date' : info . get ( 'last_modified' , '2011-08-01 00:00:00' ) , 'url' : update_url ( release [ 'url' ] , debug ) , 'platforms' : [ ] } if ( platform == '*' ) : temp_releases [ key ] [ 'platforms' ] = [ '*' ] elif ( temp_releases [ key ] [ 'platforms' ] != [ '*' ] ) : temp_releases [ key ] [ 'platforms' ] . append ( platform ) for key in temp_releases : release = temp_releases [ key ] if ( release [ 'platforms' ] == [ 'windows' , 'linux' , 'osx' ] ) : release [ 'platforms' ] = [ '*' ] output . append ( release ) return output
accepts a dict from a schema version 1 .