Changeset 6638
- Timestamp:
- Mar 27, 2009, 10:35:17 AM (16 years ago)
- Location:
- anuga_core/source/anuga/utilities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/log.py
r6583 r6638 85 85 86 86 # tell the world how we are set up 87 start_msg = (" Logfile is '%s' with logging level of %s, "87 start_msg = ("\nLogfile is '%s' with logging level of %s, " 88 88 "console logging level is %s" 89 89 % (log_filename, -
anuga_core/source/anuga/utilities/system_tools.py
r6627 r6638 294 294 # @param file_url URL of the file to fetch. 295 295 # @param file_name Path to file to create in the filesystem. 296 # @param auth Auth tuple (httpproxy, proxyuser, proxypass). 296 297 # @param blocksize Read file in this block size. 297 # @param auth Auth tuple (httpproxy, proxyuser, proxypass).298 298 # @return 'auth' tuple for subsequent calls, if successful. 299 299 # @note If 'auth' not supplied, will prompt user. … … 301 301 # @note Will try using environment variable PROXY_USERNAME for proxy username. 302 302 # @note Will try using environment variable PROXY_PASSWORD for proxy password. 303 def get_web_file(file_url, file_name, blocksize=1024*1024, auth=None):303 def get_web_file(file_url, file_name, auth=None, blocksize=1024*1024): 304 304 '''Get a file from the web.''' 305 305 … … 309 309 return None # no proxy, no auth required 310 310 except IOError, e: 311 print str(e)312 311 if e[1] != 407: 313 312 raise # raise error if *not* proxy auth error … … 345 344 346 345 # open 'net file 347 proxy = urllib2.ProxyHandler({'http': 'http://'+proxyuser+':'+proxypass 348 +'@'+httpproxy}) 346 proxy = urllib2.ProxyHandler({'http': 'http://' + proxyuser 347 + ':' + proxypass 348 + '@' + httpproxy}) 349 349 authinfo = urllib2.HTTPBasicAuthHandler() 350 350 opener = urllib2.build_opener(proxy, authinfo, urllib2.HTTPHandler)
Note: See TracChangeset
for help on using the changeset viewer.