#NEWLINE# @ app . route ( '/pypi/releases/<dist_name>' ) #NEWLINE# def releases( dist_name ) : #NEWLINE# #INDENT# ' This is the /pypi/releases/<dist_name> entry point, it is the interface\n    between Stallion and the PyPI RPC service when checking for updates.\n\n    :param dist_name: the package name (distribution name).\n    ' #NEWLINE# pkg_res = get_pkg_res ( ) #NEWLINE# data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# pkg_dist_version = pkg_res . get_distribution ( dist_name ) . version #NEWLINE# pypi_rel = get_pypi_releases ( dist_name ) #NEWLINE# data [ 'dist_name' ] = dist_name #NEWLINE# data [ 'pypi_info' ] = pypi_rel #NEWLINE# data [ 'current_version' ] = pkg_dist_version #NEWLINE# if pypi_rel : #NEWLINE# #INDENT# pypi_last_version = pkg_res . parse_version ( pypi_rel [ 0 ] ) #NEWLINE# current_version = pkg_res . parse_version ( pkg_dist_version ) #NEWLINE# last_version = ( pkg_dist_version . lower ( ) != pypi_rel [ 0 ] . lower ( ) ) #NEWLINE# data [ 'last_is_great' ] = ( pypi_last_version > current_version ) #NEWLINE# data [ 'last_version_differ' ] = last_version #NEWLINE# if data [ 'last_is_great' ] : #NEWLINE# #INDENT# DIST_PYPI_CACHE . add ( dist_name . lower ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# DIST_PYPI_CACHE . remove ( dist_name . lower ( ) ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return render_template ( 'pypi_update.html' , ** data )