Пример #1
0
 def load_module(self, *args, **kwargs):
     ChatModule.load_module(self, *args, **kwargs)
     # Creating new thread with queue in place for messaging transfers
     for channel in self.channels_list:
         self._set_chat_online(channel)
     if self.testing:
         self.testing.start()
Пример #2
0
 def _set_chat_offline(self, chat):
     ChatModule.set_chat_offline(self, chat)
     try:
         self.tw_dict[chat].stop()
     except Exception as exc:
         log.debug(exc)
     del self.tw_dict[chat]
Пример #3
0
    def __init__(self, queue, python_folder, **kwargs):
        ChatModule.__init__(self)
        log.info("Initializing funstream chat")

        # Reading config from main directory.
        conf_folder = os.path.join(python_folder, "conf")
        conf_file = os.path.join(conf_folder, "sc2tv.cfg")
        config = load_from_config_file(conf_file, CONF_DICT)
        self._conf_params.update(
            {'folder': conf_folder, 'file': conf_file,
             'filename': ''.join(os.path.basename(conf_file).split('.')[:-1]),
             'parser': config,
             'config': CONF_DICT,
             'gui': CONF_GUI})

        self.queue = queue
        self.socket = CONF_DICT['config']['socket']
        self.channels_list = CONF_DICT['config']['channels_list']
        self.fs_thread = {}

        if len(self.channels_list) == 1:
            if CONF_DICT['config']['show_channel_names']:
                CONF_DICT['config']['show_channel_names'] = False

        self.testing = kwargs.get('testing')
        if self.testing:
            self.testing = TestSc2tv(self)
Пример #4
0
 def _add_channel(self, chat):
     ChatModule._add_channel(self, chat)
     self.channels[chat] = HitboxInitThread(
         queue=self.queue,
         channel=chat,
         settings=self._conf_params['settings'],
         chat_module=self)
     self.channels[chat].start()
Пример #5
0
 def _set_chat_online(self, chat):
     ChatModule.set_chat_online(self, chat)
     gg = GGThread(self.queue,
                   self.host,
                   chat,
                   settings=self._conf_params['settings'],
                   chat_module=self)
     self.gg[chat] = gg
     gg.start()
Пример #6
0
 def load_module(self, *args, **kwargs):
     ChatModule.load_module(self, *args, **kwargs)
     if 'webchat' in self._loaded_modules:
         self._loaded_modules['webchat']['class'].add_depend('twitch')
     self._conf_params['settings']['remove_text'] = self.get_remove_text()
     for channel in self.channels_list:
         self._set_chat_online(channel)
     if self.testing:
         self.testing.start()
Пример #7
0
 def _add_channel(self, chat):
     ChatModule.add_channel(self, chat)
     self.channels[chat] = TWThread(self.queue,
                                    self.host,
                                    self.port,
                                    chat,
                                    self.bttv,
                                    settings=self._conf_params['settings'],
                                    chat_module=self)
     self.channels[chat].start()
Пример #8
0
 def load_module(self, *args, **kwargs):
     ChatModule.load_module(self, *args, **kwargs)
     if 'webchat' in self._loaded_modules:
         self._loaded_modules['webchat']['class'].add_depend('goodgame')
     self._conf_params['settings']['remove_text'] = self.get_remove_text()
     # Creating new thread with queue in place for messaging transfers
     for channel in self.channels_list:
         self._set_chat_online(channel)
     if self.testing:
         self.testing.start()
Пример #9
0
 def _set_chat_online(self, chat):
     ChatModule.set_chat_online(self, chat)
     self.tw_dict[chat] = TWThread(self.queue,
                                   self.host,
                                   self.port,
                                   chat,
                                   self.bttv,
                                   settings=self._conf_params['settings'],
                                   chat_module=self)
     self.tw_dict[chat].start()
Пример #10
0
 def _add_channel(self, chat):
     ChatModule.add_channel(self, chat)
     gg = GGThread(self.queue,
                   self.host,
                   chat,
                   self._conf_params['config']['config']['use_channel_id'],
                   settings=self._conf_params['settings'],
                   chat_module=self)
     self.channels[chat] = gg
     gg.start()
Пример #11
0
    def __init__(self, *args, **kwargs):
        log.info("Initializing twitch chat")
        ChatModule.__init__(self, *args, **kwargs)

        self.host = CONF_DICT['config']['host']
        self.port = int(CONF_DICT['config']['port'])
        self.bttv = CONF_DICT['config']['bttv']
        self.access_code = self._conf_params['config'].get('access_code')
        if self.access_code:
            headers['Authorization'] = 'OAuth {}'.format(self.access_code)

        self.rest_add('GET', 'oidc', self.parse_oidc_request)
        self.rest_add('POST', 'oidc', self.oidc_code)
Пример #12
0
    def __init__(self, queue, python_folder, **kwargs):
        ChatModule.__init__(self)
        log.info("Initializing twitch chat")

        # Reading config from main directory.
        conf_folder = os.path.join(python_folder, "conf")
        conf_file = os.path.join(conf_folder, "twitch.cfg")

        config = load_from_config_file(conf_file, CONF_DICT)
        self._conf_params.update({
            'folder':
            conf_folder,
            'file':
            conf_file,
            'filename':
            ''.join(os.path.basename(conf_file).split('.')[:-1]),
            'parser':
            config,
            'config':
            CONF_DICT,
            'gui':
            CONF_GUI,
            'settings': {}
        })

        self.queue = queue
        self.host = CONF_DICT['config']['host']
        self.port = int(CONF_DICT['config']['port'])
        self.channels_list = CONF_DICT['config']['channels_list']
        self.bttv = CONF_DICT['config']['bttv']
        self.tw_dict = {}

        if len(self.channels_list) == 1:
            if CONF_DICT['config']['show_channel_names']:
                CONF_DICT['config']['show_channel_names'] = False

        self.testing = kwargs.get('testing')
        if self.testing:
            self.testing = TestTwitch(self)
Пример #13
0
 def load_module(self, *args, **kwargs):
     ChatModule.load_module(self, *args, **kwargs)
     if 'webchat' in self._loaded_modules:
         self._loaded_modules['webchat']['class'].add_depend('twitch')
     self._conf_params['settings']['remove_text'] = self.get_remove_text()
Пример #14
0
 def _add_channel(self, chat):
     ChatModule.add_channel(self, chat)
     self.channels[chat] = FsThread(self.queue, self.socket, chat, chat_module=self)
     self.channels[chat].start()
Пример #15
0
 def __init__(self, *args, **kwargs):
     log.info("Initializing hitbox chat")
     ChatModule.__init__(self, *args, **kwargs)
Пример #16
0
    def __init__(self, *args, **kwargs):
        log.info("Initializing goodgame chat")
        ChatModule.__init__(self, *args, **kwargs)

        self.host = CONF_DICT['config']['socket']
Пример #17
0
 def __init__(self, *args, **kwargs):
     log.info("Initializing beampro chat")
     ChatModule.__init__(self, *args, **kwargs)
Пример #18
0
 def apply_settings(self, **kwargs):
     ChatModule.apply_settings(self, **kwargs)
Пример #19
0
 def _set_chat_online(self, chat):
     ChatModule.set_chat_online(self, chat)
     self.fs_thread[chat] = FsThread(self.queue, self.socket, chat, chat_module=self)
     self.fs_thread[chat].start()
Пример #20
0
 def apply_settings(self, **kwargs):
     self._check_chats(self.fs_thread.keys())
     ChatModule.apply_settings(self, **kwargs)
Пример #21
0
 def apply_settings(self, **kwargs):
     if 'webchat' in kwargs.get('from_depend', []):
         self._conf_params['settings'][
             'remove_text'] = self.get_remove_text()
     self._check_chats(self.tw_dict.keys())
     ChatModule.apply_settings(self, **kwargs)
Пример #22
0
    def __init__(self, *args, **kwargs):
        log.info("Initializing funstream chat")
        ChatModule.__init__(self, *args, **kwargs)

        self.socket = CONF_DICT['config']['socket']