__copyright__ = 'Copyright 2011 Kenneth Reitz'
-
from models import HTTPError, auth_manager
from api import *
from exceptions import *
+from settings import *
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+
+"""
+requests.settings
+~~~~~~~~~~~~~~~~~
+
+This module provides the Requests settings feature set.
+
+"""
+
+
+class Settings(object):
+
+ def __init__(self, **settings):
+ self._cache_settings(**settings)
+ self._alter_settings(**settings)
+
+ def __enter__(self):
+ pass
+
+ def __exit__(self, type, value, traceback):
+ self._restore_settings()
+
+ def _cache_settings(self, **settings):
+ self.cache = {}
+ for setting in settings:
+ self.cache[setting] = globals()[setting]
+
+ def _alter_settings(self, **settings):
+ for setting, value in settings.items():
+ globals()[setting] = value
+
+ def _restore_settings(self):
+ for setting, value in self.cache.items():
+ globals()[setting] = value
+
+
+settings = Settings
+timeout = None
\ No newline at end of file