def check_new_version(myversion, version_url):
 try:
  version = to_native(urlopen(version_url).read())
  pversion = parse_version(version)
  pmyversion = parse_version(myversion)
 except IOError:
  import traceback
  print(traceback.format_exc())
  return ((-1), myversion)
 if ((pversion[:3] + pversion[(-6):]) > (pmyversion[:3] + pmyversion[(-6):])):
  return (True, version)
 else:
  return (False, version)

def check_new_version ( myversion , version_url ) : try : version = to_native ( urlopen ( version_url ) . read ( ) ) pversion = parse_version ( version ) pmyversion = parse_version ( myversion ) except IOError : import traceback print ( traceback . format_exc ( ) ) return ( ( - 1 ) , myversion ) if ( ( pversion [ : 3 ] + pversion [ ( - 6 ) : ] ) > ( pmyversion [ : 3 ] + pmyversion [ ( - 6 ) : ] ) ) : return ( True , version ) else : return ( False , version )
compares current web2pys version with the latest stable web2py version .