コード例 #1
0
ファイル: outconn_im_slack.py プロジェクト: danlg/zato
    def _init_impl(self):

        with self.update_lock:

            # Configuration of the underlying client
            client_config = {
                'token': self.config.secret,
                'proxies': get_proxy_config(self.config)
            }

            # Create the actual connection object
            self._impl = SlackClient(**client_config)

            # Confirm the connection was established
            self.ping()

            # We can assume we are connected now
            self.is_connected = True
コード例 #2
0
ファイル: outconn_im_telegram.py プロジェクト: danlg/zato
    def _init_impl(self):

        with self.update_lock:

            # Configuration of the underlying client
            client_config = {
                'address': self.config.address,
                'connect_timeout': self.config.connect_timeout,
                'invoke_timeout': self.config.invoke_timeout,
                'token': self.config.secret or '<default-empty-telegram-token>',
                'proxies': get_proxy_config(self.config),
            }

            # Create the actual connection object
            self._impl = TelegramClient(**client_config)

            # Confirm the connection was established
            self.ping()

            # We can assume we are connected now
            self.is_connected = True