# Path: oshino/util.py
# def dynamic_import(path):
#     module, builder = path.rsplit(".", 1)
#     return getattr(__import__(module, fromlist=[builder]), builder)


import os
import yaml
import logging
import riemann_client.transport
from functools import partial
from riemann_client.transport import BlankTransport, TLSTransport, TCPTransport
from jinja2 import Template
from .util import dynamic_import





class ConfigBase(object):

    """
    Base config class
    """

    def is_valid(self):
        return True


class InstanceMixin(object):
    """
    Mixin used for configs which are loaded dynamically
    """
    @property
    def module(self):
        return self._data["module"]

    @property
    def instance(self):
        if self._instance is None:

# Path: oshino/util.py
# def dynamic_import(path):
#     module, builder = path.rsplit(".", 1)
#     return getattr(__import__(module, fromlist=[builder]), builder)


# Path: oshino/config.py
import os
import yaml
import logging
import riemann_client.transport
from functools import partial
from riemann_client.transport import BlankTransport, TLSTransport, TCPTransport
from jinja2 import Template
from .util import dynamic_import






class ConfigBase(object):

    """
    Base config class
    """

    def is_valid(self):
        return True


class InstanceMixin(object):
    """
    Mixin used for configs which are loaded dynamically
    """
    @property
    def module(self):
        return self._data["module"]

    @property
    def instance(self):
        if self._instance is None:

            self._instance = dynamic_import(self.module)(self._data)