def include_raw_constructor ( self , loader , node ) : path = convert_path ( node . value ) with open ( path , 'r' ) as f : config = f . read ( ) config = self . inject_include_info ( path , config , include_type = 'include-raw' ) self . add_file ( path , config ) return config
how to use python configparser with include files
Called when PyYaml encounters !include - raw
def include_raw_constructor(self, loader, node):
        """
        Called when PyYaml encounters '!include-raw'
        """

        path = convert_path(node.value)

        with open(path, 'r') as f:
            config = f.read()

            config = self.inject_include_info(path, config, include_type='include-raw')

            self.add_file(path, config)

            return config