cleaner patch names

This commit is contained in:
Kenneth Reitz
2011-05-14 14:24:06 -04:00
parent 14ef462263
commit 8ba12ff4f3
2 changed files with 7 additions and 11 deletions
+3 -3
View File
@@ -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
View File
@@ -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)