# Path: resources/lib/di/component.py
# class Component(yaml.YAMLObject):
#     """Symbolic base class for components"""
#     yaml_tag = u'!component'
# 
#     def __init__(self, name, module, class_name, arguments, tags, factory_class, factory_method, lazy, calls):
#         self.name = name
#         self.module = module
#         self.class_name = class_name
#         self.arguments = arguments
#         self.tags = tags
#         self.factory_class = factory_class
#         self.factory_method = factory_method
#         self.lazy = lazy
#         self.calls = calls
# 
#     @classmethod
#     def from_dict(cls, name, module=None, class_name=None, arguments=None, tags=None, factory_class=None,
#                   factory_method=None, lazy=None, calls=None, **kwargs):
#         return cls(name, module, class_name, arguments, tags, factory_class, factory_method, lazy, calls)
# 
# Path: resources/lib/di/tag.py
# class Tag(object):
#     def __init__(self, name, **kwargs):
#         self.name = name
# 
#         for key, value in kwargs.iteritems():
#             self.__setattr__(key, value)
# 
#     @classmethod
#     def from_dict(cls, name, **kwargs):
#         return cls(name, **kwargs)
# 
#     def __str__(self):
#         if hasattr(self, 'channel'):
#             return '%s->%s' % (self.name, self.channel)
#         else:
#             return self.name


import importlib
import os
import sys
import yaml
import xbmcaddon
from resources.lib.di.component import Component
from resources.lib.di.tag import Tag
                from resources.lib.di.requiredfeature import RequiredFeature
                                from resources.lib.di.requiredfeature import RequiredFeature
        for feature_definition in self.get_tagged_features('logger'):
            logger_channel = None

            for tag in feature_definition.tags:
                if tag.name == 'logger':
                    logger_channel = tag.channel
                    break

            if logger_channel is not None:
                logger_service = '@logger.%s' % logger_channel

                for key, value in enumerate(feature_definition.arguments):
                    if value[1:] == 'logger':
                        feature_definition.arguments[key] = logger_service

    def get_initialized(self, feature):
        try:
            instance = self.initialized[feature]
        except KeyError:
            instance = None

        return instance

    def set_initialized(self, feature, instance):
        if not self.allow_replace:
            assert feature not in self.initialized, "Duplicate instance: %s" % feature
        self.initialized[feature] = instance

    def execute_calls(self):
        for feature_name, feature in self.providers.iteritems():

# Path: resources/lib/di/component.py
# class Component(yaml.YAMLObject):
#     """Symbolic base class for components"""
#     yaml_tag = u'!component'
# 
#     def __init__(self, name, module, class_name, arguments, tags, factory_class, factory_method, lazy, calls):
#         self.name = name
#         self.module = module
#         self.class_name = class_name
#         self.arguments = arguments
#         self.tags = tags
#         self.factory_class = factory_class
#         self.factory_method = factory_method
#         self.lazy = lazy
#         self.calls = calls
# 
#     @classmethod
#     def from_dict(cls, name, module=None, class_name=None, arguments=None, tags=None, factory_class=None,
#                   factory_method=None, lazy=None, calls=None, **kwargs):
#         return cls(name, module, class_name, arguments, tags, factory_class, factory_method, lazy, calls)
# 
# Path: resources/lib/di/tag.py
# class Tag(object):
#     def __init__(self, name, **kwargs):
#         self.name = name
# 
#         for key, value in kwargs.iteritems():
#             self.__setattr__(key, value)
# 
#     @classmethod
#     def from_dict(cls, name, **kwargs):
#         return cls(name, **kwargs)
# 
#     def __str__(self):
#         if hasattr(self, 'channel'):
#             return '%s->%s' % (self.name, self.channel)
#         else:
#             return self.name


# Path: resources/lib/di/featurebroker.py
import importlib
import os
import sys
import yaml
import xbmcaddon
from resources.lib.di.component import Component
from resources.lib.di.tag import Tag
                from resources.lib.di.requiredfeature import RequiredFeature
                                from resources.lib.di.requiredfeature import RequiredFeature

        for feature_definition in self.get_tagged_features('logger'):
            logger_channel = None

            for tag in feature_definition.tags:
                if tag.name == 'logger':
                    logger_channel = tag.channel
                    break

            if logger_channel is not None:
                logger_service = '@logger.%s' % logger_channel

                for key, value in enumerate(feature_definition.arguments):
                    if value[1:] == 'logger':
                        feature_definition.arguments[key] = logger_service

    def get_initialized(self, feature):
        try:
            instance = self.initialized[feature]
        except KeyError:
            instance = None

        return instance

    def set_initialized(self, feature, instance):
        if not self.allow_replace:
            assert feature not in self.initialized, "Duplicate instance: %s" % feature
        self.initialized[feature] = instance

    def execute_calls(self):
        for feature_name, feature in self.providers.iteritems():

            if not isinstance(feature, Component):