# Path: autonetkit/render/exceptions.py
# class RendererNotDefined(Exception):
#     pass
# 
# Path: autonetkit/render/node/linux_host.py
# class LinuxHostRenderer(NodeRenderer):
#     def render(self, data: Dict) -> List[RenderedFileEntry]:
#         """
# 
#         @param data:
#         @return:
#         """
#         # Note: Can fill in once hosts setup
#         result = []
#         return result
# 
# Path: autonetkit/render/node/quagga.py
# class QuaggaRenderer(NodeRenderer):
#     def render(self, data: Dict) -> List[RenderedFileEntry]:
#         """
# 
#         @param data:
#         @return:
#         """
#         result = []
#         quagga_path = "etc/quagga"
# 
#         zebra_template = self.env.get_template("quagga/zebra.conf")
#         result.append(RenderedFileEntry(
#             zebra_template.render(node=data),
#             quagga_path,
#             "zebra.conf"))
# 
#         ospfd_template = self.env.get_template("quagga/ospfd.conf")
#         result.append(RenderedFileEntry(
#             ospfd_template.render(node=data),
#             quagga_path,
#             "ospfd.conf"))
# 
#         bgpd_template = self.env.get_template("quagga/bgpd.conf")
#         result.append(RenderedFileEntry(
#             bgpd_template.render(node=data),
#             quagga_path,
#             "bgpd.conf"))
# 
#         daemons_template = self.env.get_template("quagga/daemons.conf")
#         result.append(RenderedFileEntry(
#             daemons_template.render(node=data),
#             quagga_path,
#             "daemons.conf"))
# 
#         return result
# 
# Path: autonetkit/render/types.py
# class RenderedFileEntry(NamedTuple):
#     body: str
#     path: Optional[str]
#     filename: str


from typing import Dict, List
from jinja2 import Environment, PackageLoader
from autonetkit.render.exceptions import RendererNotDefined
from autonetkit.render.node.linux_host import LinuxHostRenderer
from autonetkit.render.node.quagga import QuaggaRenderer
from autonetkit.render.types import RenderedFileEntry




class Renderer:
    """

    """

    def __init__(self):
        self.env = Environment(
            loader=PackageLoader('autonetkit', 'render/templates'),
            trim_blocks=True, lstrip_blocks=True
        )

        self.target_map = {
            "quagga": QuaggaRenderer(self.env),
            "linux": LinuxHostRenderer(self.env)
        }


# Path: autonetkit/render/exceptions.py
# class RendererNotDefined(Exception):
#     pass
# 
# Path: autonetkit/render/node/linux_host.py
# class LinuxHostRenderer(NodeRenderer):
#     def render(self, data: Dict) -> List[RenderedFileEntry]:
#         """
# 
#         @param data:
#         @return:
#         """
#         # Note: Can fill in once hosts setup
#         result = []
#         return result
# 
# Path: autonetkit/render/node/quagga.py
# class QuaggaRenderer(NodeRenderer):
#     def render(self, data: Dict) -> List[RenderedFileEntry]:
#         """
# 
#         @param data:
#         @return:
#         """
#         result = []
#         quagga_path = "etc/quagga"
# 
#         zebra_template = self.env.get_template("quagga/zebra.conf")
#         result.append(RenderedFileEntry(
#             zebra_template.render(node=data),
#             quagga_path,
#             "zebra.conf"))
# 
#         ospfd_template = self.env.get_template("quagga/ospfd.conf")
#         result.append(RenderedFileEntry(
#             ospfd_template.render(node=data),
#             quagga_path,
#             "ospfd.conf"))
# 
#         bgpd_template = self.env.get_template("quagga/bgpd.conf")
#         result.append(RenderedFileEntry(
#             bgpd_template.render(node=data),
#             quagga_path,
#             "bgpd.conf"))
# 
#         daemons_template = self.env.get_template("quagga/daemons.conf")
#         result.append(RenderedFileEntry(
#             daemons_template.render(node=data),
#             quagga_path,
#             "daemons.conf"))
# 
#         return result
# 
# Path: autonetkit/render/types.py
# class RenderedFileEntry(NamedTuple):
#     body: str
#     path: Optional[str]
#     filename: str


# Path: autonetkit/render/renderer.py
from typing import Dict, List
from jinja2 import Environment, PackageLoader
from autonetkit.render.exceptions import RendererNotDefined
from autonetkit.render.node.linux_host import LinuxHostRenderer
from autonetkit.render.node.quagga import QuaggaRenderer
from autonetkit.render.types import RenderedFileEntry





class Renderer:
    """

    """

    def __init__(self):
        self.env = Environment(
            loader=PackageLoader('autonetkit', 'render/templates'),
            trim_blocks=True, lstrip_blocks=True
        )

        self.target_map = {
            "quagga": QuaggaRenderer(self.env),
            "linux": LinuxHostRenderer(self.env)
        }


    def render_node(self, compiled_data: Dict, target: str) -> List[RenderedFileEntry]: