(url, progress_updater, headers=None)
return data
download with methods given by ukconfig.download_method
        return the data
download with methods given by ukconfig.download_method
        return the data
download with methods given by ukconfig . download_method return the data
def direct_download(url, progress_updater, headers=None):
    """ download with methods given by ukconfig.download_method
        return the data
    """
    log_info("Directly Download with URL {0} ...".format(url))

    if headers is None:
        headers = {'Host': urlparse(url).netloc,
                   'User-Agent': ukconfig.USER_AGENT,
                   'Connection': 'Keep-Alive'
                  }

    # for test and cmd tools only
    if ukconfig.download_method == 'wget':
        data = wget_download(url, progress_updater, headers)
    else:
        data = requests_download(url, progress_updater, headers)
    if len(data) < ukconfig.FILE_SIZE_MINIMUM:
        raise FileCorrupted("File too small: " + parse_file_size(len(data)))
    return data
def direct_download ( url , progress_updater , headers = None ) : log_info ( "Directly Download with URL {0} ..." . format ( url ) ) if headers is None : headers = { 'Host' : urlparse ( url ) . netloc , 'User-Agent' : ukconfig . USER_AGENT , 'Connection' : 'Keep-Alive' } # for test and cmd tools only if ukconfig . download_method == 'wget' : data = wget_download ( url , progress_updater , headers ) else : data = requests_download ( url , progress_updater , headers ) if len ( data ) < ukconfig . FILE_SIZE_MINIMUM : raise FileCorrupted ( "File too small: " + parse_file_size ( len ( data ) ) ) return data