#NEWLINE# def install_anaconda_python( args , remotes ) : #NEWLINE# #INDENT# 'Provide isolated installation of Anaconda python.\n    http://docs.continuum.io/anaconda/index.html\n    ' #NEWLINE# anaconda_dir = os . path . join ( args . datadir , 'anaconda' ) #NEWLINE# bindir = os . path . join ( anaconda_dir , 'bin' ) #NEWLINE# conda = os . path . join ( bindir , 'conda' ) #NEWLINE# if platform . mac_ver ( ) [ 0 ] : #NEWLINE# #INDENT# distribution = 'macosx' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# distribution = 'linux' #NEWLINE# #UNINDENT# if ( platform . architecture ( ) [ 0 ] == '32bit' ) : #NEWLINE# #INDENT# arch = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# arch = '_64' #NEWLINE# #UNINDENT# if ( ( not os . path . exists ( anaconda_dir ) ) or ( not os . path . exists ( conda ) ) ) : #NEWLINE# #INDENT# if os . path . exists ( anaconda_dir ) : #NEWLINE# #INDENT# shutil . rmtree ( anaconda_dir ) #NEWLINE# #UNINDENT# url = ( remotes [ 'anaconda' ] % ( ( 'MacOSX' if ( distribution == 'macosx' ) else 'Linux' ) , arch ) ) #NEWLINE# if ( not os . path . exists ( os . path . basename ( url ) ) ) : #NEWLINE# #INDENT# subprocess . check_call ( [ 'wget' , '--continue' , url ] ) #NEWLINE# #UNINDENT# subprocess . check_call ( ( 'bash %s -b -p %s' % ( os . path . basename ( url ) , anaconda_dir ) ) , shell = True ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'conda' : conda , #NEWLINE# 'dir' : anaconda_dir , #NEWLINE# #UNINDENT# }