# Path: responsebot/common/exceptions.py
# class MissingConfigError(ResponseBotError):
#     """
#     Exception to indicate a required configuration for Tweet Bot is not found from config file or CLI.
#     """
#     pass


from responsebot.common.exceptions import MissingConfigError
    from ConfigParser import SafeConfigParser
    from configparser import SafeConfigParser
                'general', 'sleep_seconds_on_consecutive_errors')

    def load_config_from_cli_arguments(self, *args, **kwargs):
        """
        Get config values of passed in CLI options.

        :param dict kwargs: CLI options
        """
        self._load_config_from_cli_argument(key='handlers_package', **kwargs)
        self._load_config_from_cli_argument(key='auth', **kwargs)
        self._load_config_from_cli_argument(key='user_stream', **kwargs)
        self._load_config_from_cli_argument(key='min_seconds_between_errors', **kwargs)
        self._load_config_from_cli_argument(key='sleep_seconds_on_consecutive_errors', **kwargs)

    def _load_config_from_cli_argument(self, key, **kwargs):
        if kwargs.get(key):
            if key == 'auth':
                self._config['consumer_key'], self._config['consumer_secret'],\
                self._config['token_key'], self._config['token_secret'] = kwargs.get(key)
            else:
                self._config[key] = kwargs.get(key)

    def validate_configs(self):
        """
        Check that required config are set.
        :raises :class:`~responsebot.common.exceptions.MissingConfigError`: if a required config is missing
        """
        # Check required arguments, validate values
        for conf in self.REQUIRED_CONFIGS:
            if conf not in self._config:

# Path: responsebot/common/exceptions.py
# class MissingConfigError(ResponseBotError):
#     """
#     Exception to indicate a required configuration for Tweet Bot is not found from config file or CLI.
#     """
#     pass


# Path: responsebot/utils/config_utils.py
from responsebot.common.exceptions import MissingConfigError
    from ConfigParser import SafeConfigParser
    from configparser import SafeConfigParser

                'general', 'sleep_seconds_on_consecutive_errors')

    def load_config_from_cli_arguments(self, *args, **kwargs):
        """
        Get config values of passed in CLI options.

        :param dict kwargs: CLI options
        """
        self._load_config_from_cli_argument(key='handlers_package', **kwargs)
        self._load_config_from_cli_argument(key='auth', **kwargs)
        self._load_config_from_cli_argument(key='user_stream', **kwargs)
        self._load_config_from_cli_argument(key='min_seconds_between_errors', **kwargs)
        self._load_config_from_cli_argument(key='sleep_seconds_on_consecutive_errors', **kwargs)

    def _load_config_from_cli_argument(self, key, **kwargs):
        if kwargs.get(key):
            if key == 'auth':
                self._config['consumer_key'], self._config['consumer_secret'],\
                self._config['token_key'], self._config['token_secret'] = kwargs.get(key)
            else:
                self._config[key] = kwargs.get(key)

    def validate_configs(self):
        """
        Check that required config are set.
        :raises :class:`~responsebot.common.exceptions.MissingConfigError`: if a required config is missing
        """
        # Check required arguments, validate values
        for conf in self.REQUIRED_CONFIGS:
            if conf not in self._config:

                raise MissingConfigError('Missing required configuration %s' % conf)