merge changes
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 · parent 1f60e10 · Browse files · 2 files·+24 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+24 added−11 removed
- other:+24 added−11 removed
Provenance
- Commit
e7b8e93- Tree
f14e565- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
1f60e10
2 files changed+24 added−11 removed
modified:requests/async.py+10 added-8 removed
8 unmodified lines9 :copyright: (c) 2011 by Kenneth Reitz.10 :license: ISC, see LICENSE for more details.11 """12 13+14 from __future__ import absolute_import15 import urllib16 import urllib217 from urllib2 import HTTPError18 19+20 try:21 import eventlet22 eventlet.monkey_patch()23 except ImportError:5 unmodified lines29 monkey.patch_all()30 except ImportError:31 pass32 33+34 if not 'eventlet' in locals():35 raise ImportError('No Async adaptations of urllib2 found!')36 37+38 from .core import *39 36-__all__ = ['Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete', 'auth_manager', 'AuthObject',37- 'RequestException', 'AuthenticationError', 'URLRequired', 'InvalidMethod', 'HTTPError']38-__title__ = 'requests'39-__version__ = '0.0.1'40-__build__ = 0x00000141-__author__ = 'Dj Gilcrease'42-__license__ = 'ISC'43-__copyright__ = 'Copyright 2011 Kenneth Reitz'40+41+__all__ = [42+ 'Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete', 43+ 'auth_manager', 'AuthObject','RequestException', 'AuthenticationError', 44+ 'URLRequired', 'InvalidMethod', 'HTTPError'45+]modified:requests/core.py+14 added-3 removed
16 unmodified lines17 18 from .packages.poster.encode import multipart_encode19 from .packages.poster.streaminghttp import register_openers20 21-__all__ = ['Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete', 'auth_manager', 'AuthObject',22- 'RequestException', 'AuthenticationError', 'URLRequired', 'InvalidMethod', 'HTTPError']21+22 __title__ = 'requests'23 __version__ = '0.2.5'24 __build__ = 0x00020526-__author__ = 'Kenneth Reitz, Dj Gilcrease'25+__author__ = 'Kenneth Reitz'26 __license__ = 'ISC'27 __copyright__ = 'Copyright 2011 Kenneth Reitz'28 29+__all__ = [30+ 'Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete', 31+ 'auth_manager', 'AuthObject','RequestException', 'AuthenticationError', 32+ 'URLRequired', 'InvalidMethod', 'HTTPError'33+]34+35+36 class _Request(urllib2.Request):37 """Hidden wrapper around the urllib2.Request object. Allows for manual38 setting of HTTP methods.39 """164 unmodified lines204 """Raises stored HTTPError if one exists."""205 if self.error:206 raise self.error207 208+209+210 class AuthManager(object):211 def __new__(cls):212 singleton = cls.__dict__.get('__singleton__')213 if singleton is not None:147 unmodified lines361 r.send()362 363 return r.response364 365+366 def get(url, params={}, headers={}, cookies=None, auth=None):367 """Sends a GET request. Returns :class:`Response` object.368 369 :param url: URL for the new :class:`Request` object.58 unmodified lines428 """429 430 return request('DELETE', url, params=params, headers=headers, cookiejar=cookies, auth=auth)431 432+433+434 class RequestException(Exception):435 """There was an ambiguous exception that occured while handling your436 request."""437 8 unmodified lines