Changeset 6852
- Timestamp:
- Apr 21, 2009, 1:48:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/system_tools.py
r6834 r6852 332 332 333 333 # We get here if there was a proxy error, get file through the proxy 334 335 ## This code is how we might handle a proxy which doesn't use authentication336 ## CAN'T TEST THIS, SO NOT IMPLEMENTED337 ## proxy = {'http': 'http://%s' % httpproxy}338 ## try:339 ## webget = urllib.urlopen(file_url, proxies=proxy)340 ## else:341 ## fd = open(file_name, 'wb')342 ## while True:343 ## data = webget.read(blocksize)344 ## if len(data) == 0:345 ## break346 ## fd.write(data)347 ## fd.close348 ## webget.close()349 350 334 # unpack auth info 351 335 try: … … 392 376 opener = urllib2.build_opener(proxy, authinfo, urllib2.HTTPHandler) 393 377 urllib2.install_opener(opener) 394 webget = urllib2.urlopen(file_url) 378 try: 379 webget = urllib2.urlopen(file_url) 380 except urllib2.HTTPError: 381 return False 395 382 396 383 # transfer file to local filesystem
Note: See TracChangeset
for help on using the changeset viewer.