src/w/3/w3af-HEAD/core/data/url/handlers/HTTPNtlmAuthHandler.py w3af(Download)
class HTTPNtlmAuthHandler(AbstractNtlmAuthHandler, urllib2.BaseHandler):
auth_header = 'Authorization'
def http_error_401(self, req, fp, code, msg, headers):
return self.http_error_authentication_required('www-authenticate', req, fp, headers)
class ProxyNtlmAuthHandler(AbstractNtlmAuthHandler, urllib2.BaseHandler):
src/r/s/rsl-0.2.1/src/rsl/misc/http.py rsl(Download)
import md5 from urllib2 import Request as Urllib2Request from urllib2 import HTTPPasswordMgrWithDefaultRealm, BaseHandler from urllib2 import HTTPCookieProcessor from urllib2 import HTTPBasicAuthHandler, build_opener, install_opener from cookielib import LWPCookieJar
class CacheHandler(BaseHandler):
"""Stores responses in a persistant on-disk cache.
If a subsequent GET request is made for the same URL, the stored
response is returned, saving time, resources and bandwith"""
def __init__(self, cachelocation):
"""The location of the cache directory"""
src/k/e/keeprunning-HEAD/twill/other_packages/_mechanize_dist/_urllib2.py keeprunning(Download)
# handlers...
# ...from urllib2...
from urllib2 import \
BaseHandler, \
UnknownHandler, \
FTPHandler, \
src/k/e/keeprunning-HEAD/twill/other_packages/_mechanize_dist/_http.py keeprunning(Download)
import copy, time, tempfile, htmlentitydefs, re, logging, socket, \
urllib2, urllib, httplib, sgmllib
from urllib2 import URLError, HTTPError, BaseHandler
from cStringIO import StringIO
from _request import Request
class HTTPRedirectHandler(BaseHandler):
# maximum number of redirections to any single URL
# this is needed because of the state that cookies introduce
max_repeats = 4
# maximum total number of redirections (regardless of URL) before
# assuming we're in a loop
max_redirections = 10
class HTTPEquivProcessor(BaseHandler):
"""Append META HTTP-EQUIV headers to regular HTTP headers."""
handler_order = 300 # before handlers that look at HTTP headers
def __init__(self, head_parser_class=HeadParser,
i_want_broken_xhtml_support=False,
class HTTPCookieProcessor(BaseHandler):
"""Handle HTTP cookies.
Public attributes:
cookiejar: CookieJar instance
class HTTPRobotRulesProcessor(BaseHandler):
# before redirections, after everything else
handler_order = 800
try:
from httplib import HTTPMessage
except:
class HTTPRefererProcessor(BaseHandler):
"""Add Referer header to requests.
This only makes sense if you use each RefererProcessor for a single
chain of requests only (so, for example, if you use a single
HTTPRefererProcessor to fetch a series of URLs extracted from a single
page, this will break).
class HTTPRefreshProcessor(BaseHandler):
"""Perform HTTP Refresh redirections.
Note that if a non-200 HTTP code has occurred (for example, a 30x
redirect), this processor will do nothing.
By default, only zero-time Refresh headers are redirected. Use the
class HTTPErrorProcessor(BaseHandler):
"""Process HTTP error responses.
The purpose of this handler is to to allow other response processors a
look-in by removing the call to parent.error() from
AbstractHTTPHandler.
class HTTPDefaultErrorHandler(BaseHandler):
def http_error_default(self, req, fp, code, msg, hdrs):
# why these error methods took the code, msg, headers args in the first
# place rather than a response object, I don't know, but to avoid
# multiple wrapping, we're discarding them
if isinstance(fp, urllib2.HTTPError):
class AbstractHTTPHandler(BaseHandler):
def __init__(self, debuglevel=0):
self._debuglevel = debuglevel
def set_http_debuglevel(self, level):
self._debuglevel = level
src/w/3/w3af-HEAD/core/data/url/handlers/logHandler.py w3af(Download)
class logHandler(urllib2.BaseHandler, urllib2.HTTPDefaultErrorHandler, urllib2.HTTPRedirectHandler):
"""
Add an unique id attribute to http responses and then log them.
"""
handler_order = urllib2.HTTPErrorProcessor.handler_order -1
src/w/s/wsat-HEAD/trunk/src/crawling/ClientCookie/_urllib2_support.py wsat(Download)
class BaseHandler(urllib2.BaseHandler):
handler_order = 500
def __cmp__(self, other):
if not hasattr(other, "handler_order"):
# Try to preserve the old behavior of having custom classes
# inserted after default ones (works only for custom user
src/w/s/wsat-HEAD/src/crawling/ClientCookie/_urllib2_support.py wsat(Download)
class BaseHandler(urllib2.BaseHandler):
handler_order = 500
def __cmp__(self, other):
if not hasattr(other, "handler_order"):
# Try to preserve the old behavior of having custom classes
# inserted after default ones (works only for custom user
src/p/y/pyechonest-HEAD/pyechonest/util.py pyechonest(Download)
class MyBaseHandler(urllib2.BaseHandler):
def default_open(self, request):
if config.TRACE_API_CALLS:
logger.info("%s" % (request.get_full_url(),))
request.start_time = time.time()
return None
src/p/y/pyvm-HEAD/projects/python_in_a_can/trunk/win32/mercurial-1.6.4/lib/mercurial/byterange.py pyvm(Download)
class HTTPRangeHandler(urllib2.BaseHandler):
"""Handler that enables HTTP Range headers.
This was extremely simple. The Range header is a HTTP feature to
begin with so all this class does is tell urllib2 that the
"206 Partial Content" reponse from the HTTP server is what we
expected.
src/b/i/Bitten-HEAD/bitten/slave.py Bitten(Download)
class SaneHTTPErrorProcessor(urllib2.BaseHandler):
"The HTTPErrorProcessor defined in urllib needs some love."
handler_order = 1000
def http_response(self, request, response):
code, msg, hdrs = response.code, response.msg, response.info()
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next