(self)
return self
Loads the config data, parses and builds it. Sets ``tree`` attribute to point to Data tree.
Loads the config data, parses and builds it. Sets ``tree`` attribute to point to Data tree.
Loads the config data parses and builds it . Sets tree attribute to point to Data tree .
def load(self):
        """
        Loads the config data, parses and builds it. Sets ``tree`` attribute to point to Data tree.
        """
        if self.origin:
            self.content = open(self.origin, 'r').read()

        self.encoding = 'utf8'
        if (sys.version_info[0] >= 3 and isinstance(self.content, bytes)) or \
                (sys.version_info[0] == 2 and isinstance(self.content, str)):
            try:
                self.content = self.content.decode('utf8')
            except (UnicodeDecodeError, AttributeError):
                self.encoding = chardet.detect(self.content)['encoding']
                self.content = self.content.decode(self.encoding)

        self.nodetree = self.parser.parse(self.content)
        if self.includer is not None:
            self.nodetree = self.includer.compose(self.origin, self.nodetree)
        if self.builder is not None:
            self.tree = self.builder.build(self.nodetree)
        return self
def load ( self ) : if self . origin : self . content = open ( self . origin , 'r' ) . read ( ) self . encoding = 'utf8' if ( sys . version_info [ 0 ] >= 3 and isinstance ( self . content , bytes ) ) or ( sys . version_info [ 0 ] == 2 and isinstance ( self . content , str ) ) : try : self . content = self . content . decode ( 'utf8' ) except ( UnicodeDecodeError , AttributeError ) : self . encoding = chardet . detect ( self . content ) [ 'encoding' ] self . content = self . content . decode ( self . encoding ) self . nodetree = self . parser . parse ( self . content ) if self . includer is not None : self . nodetree = self . includer . compose ( self . origin , self . nodetree ) if self . builder is not None : self . tree = self . builder . build ( self . nodetree ) return self