From 8ba12ff4f3fb17ad5b9f21076474cbd7558ca881 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 14 May 2011 14:24:06 -0400 Subject: [PATCH] cleaner patch names --- requests/models.py | 6 +++--- requests/monkeys.py | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/requests/models.py b/requests/models.py index 5ea1969..65696bc 100644 --- a/requests/models.py +++ b/requests/models.py @@ -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 } diff --git a/requests/monkeys.py b/requests/monkeys.py index 0b74635..145838f 100644 --- a/requests/monkeys.py +++ b/requests/monkeys.py @@ -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) -- 2.7.4