From: digitalxero Date: Sat, 19 Feb 2011 16:13:10 +0000 (-0500) Subject: Added an async module to make it explicit to the user that they are using async calls. X-Git-Tag: v0.3.0^2~19^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b82b06adcb77c4a62ffd3ef7526d9f4385dfb00;p=services%2Fpython-requests.git Added an async module to make it explicit to the user that they are using async calls. --- diff --git a/requests/async.py b/requests/async.py new file mode 100644 index 0000000..a3fd22b --- /dev/null +++ b/requests/async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +""" + requests.core + ~~~~~~~~~~~~~ + + This module implements the main Requests system. + + :copyright: (c) 2011 by Kenneth Reitz. + :license: ISC, see LICENSE for more details. +""" + +from __future__ import absolute_import +import urllib +import urllib2 +from urllib2 import HTTPError + +try: + import eventlet + eventlet.monkey_patch() +except ImportError: + pass + +if not 'eventlet' in locals(): + try: + from gevent import monkey + monkey.patch_all() + except ImportError: + pass + +if not 'eventlet' in locals(): + raise ImportError('No Async adaptations of urllib2 found!') + +from .core import * + +__all__ = ['Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete', 'add_autoauth', 'AUTOAUTHS', + 'RequestException', 'AuthenticationError', 'URLRequired', 'InvalidMethod', 'HTTPError'] +__title__ = 'requests' +__version__ = '0.0.1' +__build__ = 0x000001 +__author__ = 'Dj Gilcrease' +__license__ = 'ISC' +__copyright__ = 'Copyright 2011 Dj Gilcrease' diff --git a/requests/core.py b/requests/core.py index e511b84..8e62d78 100644 --- a/requests/core.py +++ b/requests/core.py @@ -21,8 +21,8 @@ from .packages.poster.streaminghttp import register_openers __all__ = ['Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete', 'add_autoauth', 'AUTOAUTHS', 'RequestException', 'AuthenticationError', 'URLRequired', 'InvalidMethod', 'HTTPError'] __title__ = 'requests' -__version__ = '0.2.4' -__build__ = 0x000204 +__version__ = '0.2.5' +__build__ = 0x000205 __author__ = 'Kenneth Reitz' __license__ = 'ISC' __copyright__ = 'Copyright 2011 Kenneth Reitz'