Exemplo n.º 1
0
def _download_files(file_urls, username, password, download_directory='/tmp'):
    ''''''
    try:
        logon2(username, password)
    except urllib2.HTTPError:
        raise ValueError('esgf._download_files: Invalid login credentials')

    for url in file_urls:
        download(url, toDirectory=download_directory)
Exemplo n.º 2
0
def _download_files(file_urls, username, password, download_directory='/tmp'):
    ''''''
    try:
        logon(username, password)
    except HTTPError:
        raise ValueError('esgf._download_files: Invalid login credentials')

    for url in file_urls:
        download(url, toDirectory=download_directory)
Exemplo n.º 3
0
def main():
    '''Example driver program'''
    
    # step 1: obtain short-term certificate
    print 'Retrieving ESGF certificate...'
    # logon using client-side MyProxy libraries
    #if logon(USER_OPENID, USER_PASSWORD):
    #    print "...done."
    # logon through server-side MyProxy service
    if logon2(USER_OPENID, USER_PASSWORD):
        print "...done"
    
    # step 2: execute faceted search for files
    urls = main_obs4mips()
    #urls = main_cmip5()
    
    # step 3: download file(s)
    for i, url in enumerate(urls):
        if i>=1:
            break
        download(url, toDirectory=DATA_DIRECTORY)
Exemplo n.º 4
0
def main():
    '''Example driver program'''

    # step 1: obtain short-term certificate
    print 'Retrieving ESGF certificate...'
    # logon using client-side MyProxy libraries
    #if logon(USER_OPENID, USER_PASSWORD):
    #    print "...done."
    # logon through server-side MyProxy service
    if logon2(USER_OPENID, USER_PASSWORD):
        print "...done"

    # step 2: execute faceted search for files
    urls = main_obs4mips()
    #urls = main_cmip5()

    # step 3: download file(s)
    for i, url in enumerate(urls):
        if i >= 1:
            break
        download(url, toDirectory=DATA_DIRECTORY)
Exemplo n.º 5
0
def main():
    """Example driver program"""

    username = raw_input('Enter your ESGF Username:\n')
    password = raw_input('Enter your ESGF Password:\n')

    # step 1: obtain short-term certificate
    print('Retrieving ESGF certificate...')
    # logon using client-side MyProxy libraries
    if logon(username, password):
        print("...done.")

    # step 2: execute faceted search for files
    # urls = main_obs4mips()
    urls = main_cmip5()

    # step 3: download file(s)
    for i, url in enumerate(urls):
        if i >= 1:
            break
        download(url, toDirectory=DATA_DIRECTORY)