mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
cleaner patch names
This commit is contained in:
+3
-3
@@ -15,7 +15,7 @@ import zlib
|
||||
from urllib2 import HTTPError
|
||||
from urlparse import urlparse
|
||||
|
||||
from .monkeys import _Request, _HTTPBasicAuthHandler, _HTTPDigestAuthHandler
|
||||
from .monkeys import Request as _Request, HTTPBasicAuthHandler, HTTPDigestAuthHandler
|
||||
|
||||
from .packages.poster.encode import multipart_encode
|
||||
from .packages.poster.streaminghttp import register_openers, get_handlers
|
||||
@@ -405,8 +405,8 @@ class AuthObject(object):
|
||||
"""
|
||||
|
||||
_handlers = {
|
||||
'basic': _HTTPBasicAuthHandler,
|
||||
'digest': _HTTPDigestAuthHandler,
|
||||
'basic': HTTPBasicAuthHandler,
|
||||
'digest': HTTPDigestAuthHandler,
|
||||
'proxy_basic': urllib2.ProxyBasicAuthHandler,
|
||||
'proxy_digest': urllib2.ProxyDigestAuthHandler
|
||||
}
|
||||
|
||||
+4
-8
@@ -4,18 +4,14 @@
|
||||
requests.monkeys
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
Monkey patches to urllib2 and the like.
|
||||
Urllib2 Monkey patches.
|
||||
|
||||
"""
|
||||
|
||||
# import requests
|
||||
# import urllib
|
||||
import urllib2
|
||||
# import socket
|
||||
# import zlib
|
||||
|
||||
|
||||
class _Request(urllib2.Request):
|
||||
class Request(urllib2.Request):
|
||||
"""Hidden wrapper around the urllib2.Request object. Allows for manual
|
||||
setting of HTTP methods.
|
||||
"""
|
||||
@@ -31,7 +27,7 @@ class _Request(urllib2.Request):
|
||||
return urllib2.Request.get_method(self)
|
||||
|
||||
|
||||
class _HTTPBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
|
||||
class HTTPBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
|
||||
# from mercurial
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -54,7 +50,7 @@ class _HTTPBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
|
||||
|
||||
|
||||
|
||||
class _HTTPDigestAuthHandler(urllib2.HTTPDigestAuthHandler):
|
||||
class HTTPDigestAuthHandler(urllib2.HTTPDigestAuthHandler):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
urllib2.HTTPDigestAuthHandler.__init__(self, *args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user