# Path: cubetl/core/exceptions.py
# class ETLConfigurationException(ETLException):
#     pass


import logging
from cubetl.core.exceptions import ETLConfigurationException

    def __init__(self, context):

        self.components = {}

        self.ctx = context

    def component_desc(self, comp):
        if comp not in self.components:
            self.components[comp] = ComponentDescriptor()
            self.components[comp].comp = comp
            self.components[comp].initialized = False
            self.components[comp].finalized = False

        return self.components[comp]

    def is_initialized(self, comp):
        return self.component_desc(comp).initialized

    def is_finalized(self, comp):
        return self.component_desc(comp).finalized

    def initialize(self, comp):
        if (not self.is_initialized(comp)):
            logger.debug("Initializing %s" % (comp, ))
            self.component_desc(comp).initialized = True
            comp.initialize(self.ctx)
            try:
                pass
            except AttributeError as e:

# Path: cubetl/core/exceptions.py
# class ETLConfigurationException(ETLException):
#     pass


# Path: cubetl/core/components.py
import logging
from cubetl.core.exceptions import ETLConfigurationException


    def __init__(self, context):

        self.components = {}

        self.ctx = context

    def component_desc(self, comp):
        if comp not in self.components:
            self.components[comp] = ComponentDescriptor()
            self.components[comp].comp = comp
            self.components[comp].initialized = False
            self.components[comp].finalized = False

        return self.components[comp]

    def is_initialized(self, comp):
        return self.component_desc(comp).initialized

    def is_finalized(self, comp):
        return self.component_desc(comp).finalized

    def initialize(self, comp):
        if (not self.is_initialized(comp)):
            logger.debug("Initializing %s" % (comp, ))
            self.component_desc(comp).initialized = True
            comp.initialize(self.ctx)
            try:
                pass
            except AttributeError as e:

                raise ETLConfigurationException("Tried to initialize invalid component (%s): %s" % (comp, e))