示例#1
0
 def twitter_notification_available(self, key=None):
     if self.enabled(
             key
     ) and NotificationTypes.TWITTER.value in self.notification_type:
         if TwitterService.is_setup_correctly(self.config):
             return True
     return False
示例#2
0
    def __init__(self, config):
        super().__init__(config)
        self.logger = logging.getLogger(self.__class__.__name__)
        self.user_ids = []
        self.hashtags = []
        self.counter = 0
        self.social_config = {}

        # check presence of twitter instance
        if TwitterService.is_setup_correctly(self.config):
            self.twitter_service = self.config[CONFIG_CATEGORY_SERVICES][CONFIG_TWITTER][CONFIG_SERVICE_INSTANCE]
            self.is_setup_correctly = True
        else:
            self.logger.warning("Required services are not ready")
            self.is_setup_correctly = False
    def __init__(self, config):
        super().__init__(config)
        self.logger = logging.getLogger(self.__class__.__name__)
        self.user_ids = []
        self.hashtags = []
        self.counter = 0
        self.social_config = {}

        # check presence of twitter instance
        if TwitterService.is_setup_correctly(self.config):
            self.twitter_service = self.config[CONFIG_CATEGORY_SERVICES][CONFIG_TWITTER][CONFIG_SERVICE_INSTANCE]
            self.is_setup_correctly = True
        else:
            self.logger.warning("Required services are not ready")
            self.is_setup_correctly = False
示例#4
0
    def __init__(self, config, main_async_loop):
        super().__init__(config, main_async_loop)
        self.user_ids = []
        self.hashtags = []
        self.counter = 0
        self.social_config = {}

        # check presence of twitter instance
        if TwitterService.is_setup_correctly(self.config):
            self.service = self.config[CONFIG_CATEGORY_SERVICES][
                CONFIG_TWITTER][CONFIG_SERVICE_INSTANCE]
            self.is_setup_correctly = True
        else:
            if TwitterService.should_be_ready(config):
                self.logger.warning(self.REQUIRED_SERVICE_ERROR_MESSAGE)
            self.is_setup_correctly = False
    def __init__(self, config, main_async_loop):
        super().__init__(config, main_async_loop)
        self.logger = get_logger(self.__class__.__name__)
        self.user_ids = []
        self.hashtags = []
        self.counter = 0
        self.social_config = {}

        # check presence of twitter instance
        if TwitterService.is_setup_correctly(self.config):
            self.twitter_service = self.config[CONFIG_CATEGORY_SERVICES][
                CONFIG_TWITTER][CONFIG_SERVICE_INSTANCE]
            self.is_setup_correctly = True
        else:
            if TwitterService.should_be_ready(config):
                self.logger.warning(
                    "Required services are not ready, dispatcher can't start")
            self.is_setup_correctly = False
示例#6
0
 def twitter_notification_available(self, key=None):
     if self.enabled(
             key) and TwitterService.get_name() in self.notification_type:
         if TwitterService.is_setup_correctly(self.config):
             return True
     return False
 def twitter_notification_available(self, key=None):
     return self.enabled(key) and \
            self._service_instance_is_present(CONFIG_TWITTER) and \
            self.config[CONFIG_CATEGORY_SERVICES][CONFIG_TWITTER][CONFIG_SERVICE_INSTANCE].get_type() \
            in self.notification_type and \
            TwitterService.is_setup_correctly(self.config)
示例#8
0
 def twitter_notification_available(self):
     if self.enable and NotificationTypes.TWITTER.value in self.notification_type:
         if TwitterService.is_setup_correctly(self.config):
             return True
     return False