def install_opener(opener):
global _opener
_opener = opener
proxy_url = 'http://localhost:8888'
proxy_support = urllib2.ProxyHandler({'http': proxy_url})
opener = urllib2.build_opener(proxy_support, urllib2.HTTPHandler)
urllib2.install_opener(opener)
src/p/y/python-cookbook-HEAD/cb2_examples/cb2_14_7_sol_1.py python-cookbook(Download)
cj.load(COOKIEFILE)
if cookielib:
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
else:
opener = ClientCookie.build_opener(ClientCookie.HTTPCookieProcessor(cj))
ClientCookie.install_opener(opener)
src/n/o/notmm-0.4.1/examples/lib/satchmo_utils/sslurllib.py notmm(Download)
opener = urllib2.build_opener(v2handler)
# this will make our new subclassed HTTPSHandler be used for all HTTPSConnections
urllib2.install_opener(opener)
src/b/r/braintree_python_examples-HEAD/tr_checkout/checkout.py braintree_python_examples(Download)
# these requires are necessary on OSX 10.6.x to prevent # thread issues import urllib2 urllib2.install_opener(urllib2.build_opener()) import braintree import web
src/e/a/easynewsgrabber-HEAD/showDownloader.py easynewsgrabber(Download)
if row == 0: print 'I didnt find the following show: ', link.string, ' - I will download it now' from urllib2 import (HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler, build_opener, install_opener, HTTPError, Request, urlopen, URLError ) password_mgr = HTTPPasswordMgrWithDefaultRealm() password_mgr.add_password(None, "http://members.easynews.com/global4/search.html", easyNewsUsername,easyNewsPassword) handler = HTTPBasicAuthHandler(password_mgr) opener = build_opener(handler) install_opener(opener)
password_mgr.add_password(None, "http://boost4-downloads.members.easynews.com/news/", easyNewsUsername,easyNewsPassword) handler = HTTPBasicAuthHandler(password_mgr) opener = build_opener(handler) install_opener(opener) f = urlopen(downloadLink) print "downloading " + downloadLink #print f
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Doc/sphinx/ext/intersphinx.py ironruby(Download)
if hasattr(urllib2, 'HTTPSHandler'):
handlers.append(urllib2.HTTPSHandler)
urllib2.install_opener(urllib2.build_opener(*handlers))
def fetch_inventory(app, uri, inv):
src/w/3/w3af-HEAD/core/data/url/handlers/HTTPNtlmAuthHandler.py w3af(Download)
opener = urllib2.build_opener(proxy_handler, auth_NTLM) #, auth_digest, auth_basic)
urllib2.install_opener(opener)
response = urllib2.urlopen(url)
print(response.read())
src/n/a/nagstamon-HEAD/Nagstamon/Nagstamon/nagstamonServer/Generic.py nagstamon(Download)
urlopener = urllib2.build_opener(proxy_handler, proxy_auth_handler, auth_handler, digest_handler, urllib2.HTTPCookieProcessor(self.Cookie))
# create url opener
urllib2.install_opener(urlopener)
# login and get cookie
urlcontent = urllib2.urlopen(self.nagios_url + "/login", logindata)
urlopener = urllib2.build_opener(proxy_handler, proxy_auth_handler, auth_handler, digest_handler, urllib2.HTTPCookieProcessor(self.Cookie), nagstamonActions.MultipartPostHandler)
# create url opener
urllib2.install_opener(urlopener)
try:
# special Opsview treatment, transmit username and passwort for XML requests
# http://docs.opsview.org/doku.php?id=opsview3.4:api
src/p/y/pyvm-HEAD/projects/python_in_a_can/trunk/win32/mercurial-1.6.4/lib/mercurial/keepalive.py pyvm(Download)
def error_handler(url):
global HANDLE_ERRORS
orig = HANDLE_ERRORS
keepalive_handler = HTTPHandler()
opener = urllib2.build_opener(keepalive_handler)
urllib2.install_opener(opener)
pos = {0: 'off', 1: 'on'}
def continuity(url):
format = '%25s: %s'
# first fetch the file with the normal http handler
opener = urllib2.build_opener()
urllib2.install_opener(opener)
fo = urllib2.urlopen(url)
# now install the keepalive handler and try again
opener = urllib2.build_opener(HTTPHandler())
urllib2.install_opener(opener)
fo = urllib2.urlopen(url)
foo = fo.read()
def comp(N, url):
print ' making %i connections to:\n %s' % (N, url)
sys.stdout.write(' first using the normal urllib handlers')
# first use normal opener
opener = urllib2.build_opener()
urllib2.install_opener(opener)
t1 = fetch(N, url)
print ' TIME: %.3f s' % t1
sys.stdout.write(' now using the keepalive handler ')
# now install the keepalive handler and try again
opener = urllib2.build_opener(HTTPHandler())
urllib2.install_opener(opener)
src/w/3/w3af-HEAD/core/data/url/handlers/keepalive.py w3af(Download)
def error_handler(url):
global HANDLE_ERRORS
orig = HANDLE_ERRORS
keepalive_handler = HTTPHandler()
opener = urllib2.build_opener(keepalive_handler)
urllib2.install_opener(opener)
pos = {0: 'off', 1: 'on'}
def continuity(url):
import md5
format = '%25s: %s'
# first fetch the file with the normal http handler
opener = urllib2.build_opener()
urllib2.install_opener(opener)
# now install the keepalive handler and try again
opener = urllib2.build_opener(HTTPHandler())
urllib2.install_opener(opener)
fo = urllib2.urlopen(url)
foo = fo.read()
def comp(N, url):
print ' making %i connections to:\n %s' % (N, url)
sys.stdout.write(' first using the normal urllib handlers')
# first use normal opener
opener = urllib2.build_opener()
urllib2.install_opener(opener)
t1 = fetch(N, url)
print ' TIME: %.3f s' % t1
sys.stdout.write(' now using the keepalive handler ')
# now install the keepalive handler and try again
opener = urllib2.build_opener(HTTPHandler())
urllib2.install_opener(opener)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next