def check_update(github_slug, current_version, prereleases=False):
 releases = get_valid_releases(github_slug, prereleases)
 wf().logger.info(u'{0} releases for {1}'.format(len(releases), github_slug))
 if (not len(releases)):
  raise ValueError(u'No valid releases for {0}'.format(github_slug))
 latest_release = releases[0]
 vr = Version(latest_release[u'version'])
 vl = Version(current_version)
 wf().logger.debug(u'Latest : {0!r} Installed : {1!r}'.format(vr, vl))
 if (vr > vl):
  wf().cache_data(u'__workflow_update_status', {u'version': latest_release[u'version'], u'download_url': latest_release[u'download_url'], u'available': True})
  return True
 wf().cache_data(u'__workflow_update_status', {u'available': False})
 return False

def check_update ( github_slug , current_version , prereleases = False ) : releases = get_valid_releases ( github_slug , prereleases ) wf ( ) . logger . info ( u'{0} releases for {1}' . format ( len ( releases ) , github_slug ) ) if ( not len ( releases ) ) : raise ValueError ( u'No valid releases for {0}' . format ( github_slug ) ) latest_release = releases [ 0 ] vr = Version ( latest_release [ u'version' ] ) vl = Version ( current_version ) wf ( ) . logger . debug ( u'Latest : {0!r} Installed : {1!r}' . format ( vr , vl ) ) if ( vr > vl ) : wf ( ) . cache_data ( u'__workflow_update_status' , { u'version' : latest_release [ u'version' ] , u'download_url' : latest_release [ u'download_url' ] , u'available' : True } ) return True wf ( ) . cache_data ( u'__workflow_update_status' , { u'available' : False } ) return False
check whether a newer release is available on github .