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)
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)
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)