Skip to content
Myr

Merge branch 'develop'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents c60618a, 8836c4b · Browse files · 7 files+27 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+27 added−12 removed

  • other:+27 added−12 removed

7 files+27 added−12 removed

modified:requests/__init__.py+3 added-3 removed
13 unmodified lines
1415"""1617__title__ = 'requests'18__version__ = '0.7.3'19__build__ = 0x00070318__version__ = '0.7.4'19__build__ = 0x00070420__author__ = 'Kenneth Reitz'21__license__ = 'ISC'22__copyright__ = 'Copyright 2011 Kenneth Reitz'232425from . import utils26from .models import HTTPError, Request, Response26from .models import Request, Response27from .api import request, get, head, post, patch, put, delete28from .sessions import session29from .status_codes import codes30from .exceptions import (
3 unmodified lines
modified:requests/async.py+4 added-1 removed
30 unmodified lines
31def patched(f):32 """Patches a given API function to not send."""3334 def wrapped(*args, **kwargs):35 return f(*args, return_response=False, **kwargs)3536 kwargs['return_response'] = False3738 return f(*args, **kwargs)3940 return wrapped414243def send(r, pools=None):
38 unmodified lines
modified:requests/defaults.py+1 added
24 unmodified lines
2526defaults['base_headers'] = {27 'User-Agent': 'python-requests/%s' % __version__,28 'Accept-Encoding': ', '.join(('identity', 'deflate', 'compress', 'gzip')),29 'Accept': '*/*'30}3132defaults['proxies'] = {}33defaults['verbose'] = None
6 unmodified lines
modified:requests/models.py+4 added-3 removed
10 unmodified lines
11import urllib212import socket13import zlib1415from urllib2 import HTTPError15from urlparse import urlparse, urlunparse, urljoin16from datetime import datetime1718from .auth import dispatch as auth_dispatch19from .hooks import dispatch_hook20from .structures import CaseInsensitiveDict21from .packages.poster.encode import multipart_encode22from .packages.poster.streaminghttp import register_openers, get_handlers23from .utils import (dict_from_cookiejar, get_unicode_from_response, stream_decode_response_unicode, decode_gzip, stream_decode_gzip)23from .status_codes import codes24from .exceptions import Timeout, URLRequired, TooManyRedirects25from .monkeys import Request as _Request26from .monkeys import HTTPRedirectHandler27from .utils import (28 dict_from_cookiejar, get_unicode_from_response,29 stream_decode_response_unicode, decode_gzip, stream_decode_gzip)3029from .auth import dispatch as auth_dispatch3132REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)3334
486 unmodified lines
modified:requests/sessions.py+8 added-4 removed
49 unmodified lines
5051class Session(object):52 """A Requests session."""5354 __attrs__ = ['headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks', 'params', 'config']54 __attrs__ = [55 'headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks',56 'params', 'config']575859 def __init__(self,60 headers=None,
2 unmodified lines
63 timeout=None,64 proxies=None,65 hooks=None,66 params=None,65 config=None):67 config=None,68 keep_alive=True):6970 self.headers = headers or {}71 self.cookies = cookies or {}72 self.auth = auth
1 unmodified line
74 self.proxies = proxies or {}75 self.hooks = hooks or {}76 self.params = params or {}77 self.config = config or {}78 self.keep_alive = keep_alive7980 for (k, v) in defaults.items():81 self.config.setdefault(k, v)82
77 unmodified lines
160 local_val = args.get(attr)161162 args[attr] = merge_kwargs(local_val, session_val)163164165 # Arguments manipulation hook.161 args = dispatch_hook('args', hooks, args)166 args = dispatch_hook('args', args['hooks'], args)167168 r = Request(**args)169170 # Don't send if asked nicely.
2 unmodified lines
173174 # Send the HTTP Request.175 r.send()176172177 return r.response178179180 def get(self, url, **kwargs):
69 unmodified lines
modified:AUTHORS+2 added-1 removed
44 unmodified lines
45- Johan Bergström46- Josselin Jacquard47- Travis N. Vaught48- Fredrik Möllerstrand49- Daniel Hengeveld49- Daniel Hengeveld50- Dan Head
modified:HISTORY.rst+5 added
1History2-------340.7.4 (2011-10-26)5++++++++++++++++++67* Sesion Hooks fix.890.7.3 (2011-10-23)10++++++++++++++++++1112* Digest Auth fix.
218 unmodified lines