def upgrade_center():
 try:
  current = pkg_resources.get_distribution('rainbowstream').version
  url = 'https://raw.githubusercontent.com/DTVD/rainbowstream/master/setup.py'
  readme = requests.get(url).text
  latest = readme.split("version = '")[1].split("'")[0]
  g['using_latest'] = (current == latest)
  if (not g['using_latest']):
   notice = light_magenta('RainbowStream latest version is ')
   notice += light_green(latest)
   notice += light_magenta(' while your current version is ')
   notice += (light_yellow(current) + '\n')
   notice += light_magenta('You should upgrade with ')
   notice += light_green('pip install -U rainbowstream')
  else:
   notice = light_yellow('You are running latest version (')
   notice += light_green(current)
   notice += light_yellow(')')
   notice += '\n'
  printNicely(notice)
 except:
  pass

def upgrade_center ( ) : try : current = pkg_resources . get_distribution ( 'rainbowstream' ) . version url = 'https://raw.githubusercontent.com/DTVD/rainbowstream/master/setup.py' readme = requests . get ( url ) . text latest = readme . split ( "version = '" ) [ 1 ] . split ( "'" ) [ 0 ] g [ 'using_latest' ] = ( current == latest ) if ( not g [ 'using_latest' ] ) : notice = light_magenta ( 'RainbowStream latest version is ' ) notice += light_green ( latest ) notice += light_magenta ( ' while your current version is ' ) notice += ( light_yellow ( current ) + '\n' ) notice += light_magenta ( 'You should upgrade with ' ) notice += light_green ( 'pip install -U rainbowstream' ) else : notice = light_yellow ( 'You are running latest version (' ) notice += light_green ( current ) notice += light_yellow ( ')' ) notice += '\n' printNicely ( notice ) except : pass
check latest and notify to upgrade .