from core import *
from core import __version__
-
-timeout = None
-
-class settings:
-
- 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
\ No newline at end of file
"""
-import requests
+import settings
from .models import Request, Response, AuthManager, AuthObject, auth_manager
r = Request(method=method, url=url, data=data, headers=kwargs.pop('headers', {}),
cookiejar=kwargs.pop('cookies', None), files=kwargs.pop('files', None),
auth=kwargs.pop('auth', auth_manager.get_auth(url)),
- timeout=kwargs.pop('timeout', requests.timeout))
+ timeout=kwargs.pop('timeout', settings.timeout))
+
r.send()
return r.response
from models import HTTPError, auth_manager
from api import *
from exceptions import *
-from settings import *
\ No newline at end of file
+from settings import settings
\ No newline at end of file