#NEWLINE# def fetch( url ) : #NEWLINE# #INDENT# settings = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# pcSettings = sublime . load_settings ( 'Package Control.sublime-settings' ) #NEWLINE# setting_names = [ 'cache_length' , 'certs' , 'debug' , 'http_cache' , 'http_cache_length' , 'http_proxy' , 'https_proxy' , 'openssl_binary' , 'proxy_password' , 'proxy_username' , 'timeout' , 'user_agent' ] #NEWLINE# for setting in setting_names : #NEWLINE# #INDENT# if ( pcSettings . get ( setting ) == None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# settings [ setting ] = pcSettings . get ( setting ) #NEWLINE# #UNINDENT# no_https_proxy = ( settings . get ( 'https_proxy' ) in [ '' , None ] ) #NEWLINE# if ( no_https_proxy and settings . get ( 'http_proxy' ) ) : #NEWLINE# #INDENT# settings [ 'https_proxy' ] = settings . get ( 'http_proxy' ) #NEWLINE# #UNINDENT# if ( settings . get ( 'https_proxy' ) == False ) : #NEWLINE# #INDENT# settings [ 'https_proxy' ] = '' #NEWLINE# #UNINDENT# settings [ 'platform' ] = sublime . platform ( ) #NEWLINE# settings [ 'version' ] = sublime . version ( ) #NEWLINE# with downloader ( setting , settings ) as manager : #NEWLINE# #INDENT# return manager . fetch ( url , 'Error downloading from {0}' . format ( url ) )