예제 #1
0
 def __getattr__(self, key):
     """Tries to get the attribute off the wrapped object first, 
     if that does not work, tries dictionary lookup, and finally
     tries to grab all keys that start with the attribute and
     return sub-dictionary, that can be looked up. """
     try: 
         return self.config_proxy.__getattribute__(key)
     except AttributeError:
         try:
             return self.config_proxy.current_conf()[key]
         except KeyError:
             get_partial_dict(key, self.config_proxy.current_conf())
예제 #2
0
    def __getattr__(self, key):
        """Our custom attribute getter.

        Tries to get the attribute off the wrapped object first,
        if that does not work, tries dictionary lookup, and finally
        tries to grab all keys that start with the attribute and
        return sub-dictionaries that can be looked up.

        """
        try:
            return self.config_proxy.__getattribute__(key)
        except AttributeError:
            try:
                return self.config_proxy.current_conf()[key]
            except KeyError:
                return get_partial_dict(key, self.config_proxy.current_conf())
예제 #3
0
 def pylons(self):
     return get_partial_dict('pylons', self.config_proxy.current_conf())