#NEWLINE# @ property #NEWLINE# def candidate_version( self ) : #NEWLINE# #INDENT# if ( not hasattr ( self , '_candidate_version' ) ) : #NEWLINE# #INDENT# if ( ( not self . resource . version ) and re . match ( '^[A-Za-z0-9_.-]+$' , self . resource . package_name ) ) : #NEWLINE# #INDENT# p = Popen ( [ self . easy_install_binary_path , '-n' , self . resource . package_name ] , stdout = PIPE , stderr = STDOUT ) #NEWLINE# out = p . communicate ( ) [ 0 ] #NEWLINE# res = p . wait ( ) #NEWLINE# if ( res != 0 ) : #NEWLINE# #INDENT# self . log . warning ( ( 'easy_install check returned a non-zero result (%d) %s' % ( res , self . resource ) ) ) #NEWLINE# #UNINDENT# m = best_match_re . search ( out ) #NEWLINE# if ( not out ) : #NEWLINE# #INDENT# self . _candidate_version = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _candidate_version = m . group ( 2 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _candidate_version = self . resource . version #NEWLINE# #UNINDENT# #UNINDENT# return self . _candidate_version