def fetch_from_url_to_file(url, config, output_file, data=None, handlers=None):
 (return_code, return_message, response) = open_url(url, config, data=data, handlers=handlers)
 if (return_code == http_client_.OK):
  return_data = response.read()
  response.close()
  outfile = open(output_file, 'w')
  outfile.write(return_data)
  outfile.close()
 return (return_code, return_message, (return_code == http_client_.OK))

def fetch_from_url_to_file ( url , config , output_file , data = None , handlers = None ) : ( return_code , return_message , response ) = open_url ( url , config , data = data , handlers = handlers ) if ( return_code == http_client_ . OK ) : return_data = response . read ( ) response . close ( ) outfile = open ( output_file , 'w' ) outfile . write ( return_data ) outfile . close ( ) return ( return_code , return_message , ( return_code == http_client_ . OK ) )
writes data retrieved from a url to a file .