diff options
author | 2011-11-06 03:43:04 +0100 | |
---|---|---|
committer | 2011-11-06 03:43:04 +0100 | |
commit | 79b46e920e1f7462ffad6100dad5ed3fa6d9009a (patch) | |
tree | 57de0310caf06b09b0fa21faf529aaa0d7ee8a45 /github3/config.py | |
parent | Doc and refactorize (diff) | |
download | python-github3-79b46e920e1f7462ffad6100dad5ed3fa6d9009a.tar.xz python-github3-79b46e920e1f7462ffad6100dad5ed3fa6d9009a.zip |
Cleaning files from origin repo
Diffstat (limited to 'github3/config.py')
-rw-r--r-- | github3/config.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/github3/config.py b/github3/config.py deleted file mode 100644 index 6fec55f..0000000 --- a/github3/config.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -github3.config -~~~~~~~~~~~~~~ - -This module provides the Github3 settings feature set. - -""" - -class Settings(object): - _singleton = {} - - # attributes with defaults - __attrs__ = [] - - def __init__(self, **kwargs): - super(Settings, self).__init__() - - self.__dict__ = self._singleton - - - def __call__(self, *args, **kwargs): - # new instance of class to call - r = self.__class__() - - # cache previous settings for __exit__ - r.__cache = self.__dict__.copy() - map(self.__cache.setdefault, self.__attrs__) - - # set new settings - self.__dict__.update(*args, **kwargs) - - return r - - - def __enter__(self): - pass - - - def __exit__(self, *args): - - # restore cached copy - self.__dict__.update(self.__cache.copy()) - del self.__cache - - - def __getattribute__(self, key): - if key in object.__getattribute__(self, '__attrs__'): - try: - return object.__getattribute__(self, key) - except AttributeError: - return None - return object.__getattribute__(self, key) - -settings = Settings() -settings.verbose = True -settings.base_url = 'https://api.github.com/' |