doctoring for Session

This commit is contained in:
Kenneth Reitz
2011-08-16 22:20:26 -04:00
parent 5bb18810d4
commit efba606e57
+5
View File
@@ -13,8 +13,11 @@ import requests.api
import cookielib
class Session(object):
"""A Requests session."""
__attrs__ = ['headers', 'cookies', 'auth', 'timeout', 'proxies']
def __init__(self, **kwargs):
# Set up a CookieJar to be used by default
@@ -27,9 +30,11 @@ class Session(object):
# Map and wrap requests.api methods
self._map_api_methods()
def __repr__(self):
return '<requests-client at 0x%x>' % (id(self))
def _map_api_methods(self):
"""Reads each available method from requests.api and decorates
them with a wrapper, which inserts any instance-local attributes