def __init__(self, config):
        super().__init__(config)
        self.logger = logging.getLogger(self.__class__.__name__)
        self.subreddits = None
        self.counter = 0
        self.social_config = {}

        # check presence of twitter instance
        if RedditService.is_setup_correctly(self.config):
            self.reddit_service = self.config[CONFIG_CATEGORY_SERVICES][
                CONFIG_REDDIT][CONFIG_SERVICE_INSTANCE]
            self.is_setup_correctly = True
        else:
            self.logger.warning("Required services are not ready")
            self.is_setup_correctly = False
Exemple #2
0
    def __init__(self, config, main_async_loop):
        super().__init__(config, main_async_loop)
        self.subreddits = None
        self.counter = 0
        self.connect_attempts = 0
        self.social_config = {}
        self.credentials_ok = False

        # check presence of twitter instance
        if RedditService.is_setup_correctly(self.config):
            self.service = self.config[CONFIG_CATEGORY_SERVICES][
                CONFIG_REDDIT][CONFIG_SERVICE_INSTANCE]
            self.is_setup_correctly = True
        else:
            if RedditService.should_be_ready(config):
                self.logger.warning(self.REQUIRED_SERVICE_ERROR_MESSAGE)
            self.is_setup_correctly = False
    def __init__(self, config):
        super().__init__(config)
        self.logger = logging.getLogger(self.__class__.__name__)
        self.subreddits = None
        self.counter = 0
        self.connect_attempts = 0
        self.social_config = {}
        self.credentials_ok = False

        # check presence of twitter instance
        if RedditService.is_setup_correctly(self.config):
            self.reddit_service = self.config[CONFIG_CATEGORY_SERVICES][CONFIG_REDDIT][CONFIG_SERVICE_INSTANCE]
            self.is_setup_correctly = True
        else:
            if RedditService.should_be_ready(config):
                self.logger.warning("Required services are not ready, dispatcher can't start")
            self.is_setup_correctly = False