Skip to content
Myr

slimming down the repo

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent d5a0384 · Browse files · 3 files+0 added−60 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+0 added−60 removed

  • other:+0 added−60 removed

3 files+0 added−60 removed

modified:requests/config.py-37 removed
7 unmodified lines
89"""1011class Settings(object):12 _singleton = {}1214 # attributes with defaults15 __attrs__ = []1613 def __init__(self, **kwargs):14 super(Settings, self).__init__()1520 self.__dict__ = self._singleton212223 def __call__(self, *args, **kwargs):24 # new instance of class to call25 r = self.__class__()2627 # cache previous settings for __exit__28 r.__cache = self.__dict__.copy()29 map(self.__cache.setdefault, self.__attrs__)3031 # set new settings32 self.__dict__.update(*args, **kwargs)3334 return r353637 def __enter__(self):38 pass394041 def __exit__(self, *args):4243 # restore cached copy44 self.__dict__.update(self.__cache.copy())45 del self.__cache464716 def __getattribute__(self, key):49 if key in object.__getattribute__(self, '__attrs__'):50 try:51 return object.__getattribute__(self, key)52 except AttributeError:53 return None17 return object.__getattribute__(self, key)181920settings = Settings()
11 unmodified lines
deleted:HACKING-15 removed
1Where possible, please follow PEP8 with regard to coding style. Sometimes the2line length restriction is too hard to follow, so don't bend over backwards3there.45Triple-quotes should always be """, single quotes are ' unless using " would6result in less escaping within the string.78All modules, functions, and methods should be well documented reStructuredText9for Sphinx AutoDoc.1011All functionality should be available in pure Python. Optional C (via Cython)12implementations may be written for performance reasons, but should never13replace the Python implementation.1415Lastly, don't take yourself too seriously :)
deleted:tox.ini-8 removed
1[tox]2envlist = py25,py26,py2734[testenv]5commands=py.test --junitxml=junit-{envname}.xml6deps =7 pytest8 omnijson