(self, source, namespace='', make_namespaces=False)
return self
Import values from a dictionary structure. Nesting can be used to
            represent namespaces.

            >>> ConfigDict().load_dict({'name': {'space': {'key': 'value'}}})
            {'name.space.key': 'value'}
Import values from a dictionary structure. Nesting can be used to
            represent namespaces.
Import values from a dictionary structure . Nesting can be used to represent namespaces .
def load_dict(self, source, namespace='', make_namespaces=False):
        ''' Import values from a dictionary structure. Nesting can be used to
            represent namespaces.

            >>> ConfigDict().load_dict({'name': {'space': {'key': 'value'}}})
            {'name.space.key': 'value'}
        '''
        stack = [(namespace, source)]
        while stack:
            prefix, source = stack.pop()
            if not isinstance(source, dict):
                raise TypeError('Source is not a dict (r)' % type(key))
            for key, value in source.items():
                if not isinstance(key, basestring):
                    raise TypeError('Key is not a string (%r)' % type(key))
                full_key = prefix + '.' + key if prefix else key
                if isinstance(value, dict):
                    stack.append((full_key, value))
                    if make_namespaces:
                        self[full_key] = self.Namespace(self, full_key)
                else:
                    self[full_key] = value
        return self
def load_dict ( self , source , namespace = '' , make_namespaces = False ) : stack = [ ( namespace , source ) ] while stack : prefix , source = stack . pop ( ) if not isinstance ( source , dict ) : raise TypeError ( 'Source is not a dict (r)' % type ( key ) ) for key , value in source . items ( ) : if not isinstance ( key , basestring ) : raise TypeError ( 'Key is not a string (%r)' % type ( key ) ) full_key = prefix + '.' + key if prefix else key if isinstance ( value , dict ) : stack . append ( ( full_key , value ) ) if make_namespaces : self [ full_key ] = self . Namespace ( self , full_key ) else : self [ full_key ] = value return self