From ee6c638e9cfdbdf39b9e499d95c353460365f42c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 17 Dec 2012 03:51:23 -0500 Subject: [PATCH] hmmm --- requests/hooks.py | 7 ++----- requests/models.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/requests/hooks.py b/requests/hooks.py index 9a35fb1..6a50410 100644 --- a/requests/hooks.py +++ b/requests/hooks.py @@ -8,9 +8,6 @@ This module provides the capabilities for the Requests hooks system. Available hooks: -``args``: - A dictionary of the arguments being sent to Request(). - ``pre_request``: The Request object, directly after being created. @@ -26,8 +23,8 @@ Available hooks: """ -HOOKS = ('args', 'pre_request', 'pre_send', 'post_request', 'response') - +HOOKS = ('pre_prepare', 'post_prepare', 'pre_request', 'pre_send', 'post_request', 'response') +# TODO: response is the only one def dispatch_hook(key, hooks, hook_data): """Dispatches a hook dictionary on a given piece of data.""" diff --git a/requests/models.py b/requests/models.py index e7c6a16..316dc40 100644 --- a/requests/models.py +++ b/requests/models.py @@ -7,12 +7,12 @@ requests.models This module contains the primary objects that power Requests. """ -import os -import socket -import collections +# import os +# import socket +# import collections import logging -from datetime import datetime +# from datetime import datetime from io import BytesIO from .hooks import dispatch_hook, HOOKS @@ -21,11 +21,11 @@ from .status_codes import codes from .auth import HTTPBasicAuth, HTTPProxyAuth from .cookies import cookiejar_from_dict, extract_cookies_to_jar, get_cookie_header -from .packages.urllib3.exceptions import MaxRetryError, LocationParseError -from .packages.urllib3.exceptions import TimeoutError -from .packages.urllib3.exceptions import SSLError as _SSLError -from .packages.urllib3.exceptions import HTTPError as _HTTPError -from .packages.urllib3 import connectionpool, poolmanager +# from .packages.urllib3.exceptions import MaxRetryError, LocationParseError +# from .packages.urllib3.exceptions import TimeoutError +# from .packages.urllib3.exceptions import SSLError as _SSLError +# from .packages.urllib3.exceptions import HTTPError as _HTTPError +# from .packages.urllib3 import connectionpool, poolmanager from .packages.urllib3.filepost import encode_multipart_formdata from .exceptions import ( -- 2.7.4