How to use the slixmpp.ClientXMPP.__init__ function in slixmpp

To help you get started, we’ve selected a few slixmpp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poezio / slixmpp / examples / s5b_transfer / s5b_sender.py View on Github external
def __init__(self, jid, password, receiver, filename):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        self.receiver = receiver

        self.file = open(filename, 'rb')

        # The session_start event will be triggered when
        # the bot establishes its connection with the server
        # and the XML streams are ready for use.
        self.add_event_handler("session_start", self.start)
github poezio / slixmpp / examples / ibb_transfer / ibb_sender.py View on Github external
def __init__(self, jid, password, receiver, filename, use_messages=False):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        self.receiver = receiver

        self.file = open(filename, 'rb')
        self.use_messages = use_messages

        # The session_start event will be triggered when
        # the bot establishes its connection with the server
        # and the XML streams are ready for use. We want to
        # listen for this event so that we we can initialize
        # our roster.
        self.add_event_handler("session_start", self.start)
github poezio / slixmpp / examples / adhoc_provider.py View on Github external
def __init__(self, jid, password):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        # The session_start event will be triggered when
        # the bot establishes its connection with the server
        # and the XML streams are ready for use. We want to
        # listen for this event so that we we can initialize
        # our roster.
        self.add_event_handler("session_start", self.start)
github poezio / slixmpp / examples / thirdparty_auth.py View on Github external
def __init__(self, jid, password):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        # The X-GOOGLE-TOKEN mech is ranked lower than PLAIN
        # due to Google only allowing a single SASL attempt per
        # connection. So PLAIN will be used for TLS connections,
        # and X-GOOGLE-TOKEN for non-TLS connections. To use
        # X-GOOGLE-TOKEN with a TLS connection, explicitly select
        # it using:
        #
        # slixmpp.ClientXMPP.__init__(self, jid, password,
        #                               sasl_mech="X-GOOGLE-TOKEN")

        # The session_start event will be triggered when
        # the bot establishes its connection with the server
        # and the XML streams are ready for use. We want to
        # listen for this event so that we we can initialize
        # our roster.
github poezio / slixmpp / examples / admin_commands.py View on Github external
def __init__(self, jid, password, command):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        self.command = command

        self.add_event_handler("session_start", self.start)
github poezio / slixmpp / examples / custom_stanzas / custom_stanza_provider.py View on Github external
def __init__(self, jid, password):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        # The session_start event will be triggered when
        # the bot establishes its connection with the server
        # and the XML streams are ready for use. We want to
        # listen for this event so that we we can initialize
        # our roster.
        self.add_event_handler("session_start", self.start)

        self.register_handler(
          Callback('Some custom iq',
            StanzaPath('iq@type=set/action'),
            self._handle_action))

        self.add_event_handler('custom_action',
                self._handle_action_event)
github poezio / slixmpp / examples / adhoc_user.py View on Github external
def __init__(self, jid, password, other, greeting):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        self.command_provider = other
        self.greeting = greeting

        # The session_start event will be triggered when
        # the bot establishes its connection with the server
        # and the XML streams are ready for use. We want to
        # listen for this event so that we we can initialize
        # our roster.
        self.add_event_handler("session_start", self.start)
        self.add_event_handler("message", self.message)
github jheling / freeathome / freeathome / pfreeathome.py View on Github external
def __init__(self, jid, password, host, port, fahversion, iterations=None, salt=None):
        """ x   """
        slixmpp.ClientXMPP.__init__(self, jid, password, sasl_mech='SCRAM-SHA-1')

        self.fahversion = fahversion
        self.x_jid = jid
        self._host = host
        self._port = port

        LOG.info(' version: %s', self.fahversion)

        self.password = password
        self.iterations = iterations
        self.salt = salt

        if version.parse(self.fahversion) >= version.parse("2.3.0"):
            self.saslhandler = SaslHandler(self, self.jid, self.password, self.iterations, self.salt)

        import os
github poezio / slixmpp / examples / confirm_ask.py View on Github external
def __init__(self, jid, password, recipient, id, url, method):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        self.recipient = recipient
        self.id = id
        self.url = url
        self.method = method

        # Will be used to set the proper exit code.
        self.confirmed = asyncio.Future()

        self.add_event_handler("session_start", self.start)
        self.add_event_handler("message", self.start)
        self.add_event_handler("http_confirm_message", self.confirm)
github poezio / slixmpp / examples / gtalk_custom_domain.py View on Github external
def __init__(self, jid, password):
        slixmpp.ClientXMPP.__init__(self, jid, password)

        # The session_start event will be triggered when
        # the bot establishes its connection with the server
        # and the XML streams are ready for use. We want to
        # listen for this event so that we we can initialize
        # our roster.
        self.add_event_handler("session_start", self.start)

        # The message event is triggered whenever a message
        # stanza is received. Be aware that that includes
        # MUC messages and error messages.
        self.add_event_handler("message", self.message)

        # Using a Google Apps custom domain, the certificate
        # does not contain the custom domain, just the GTalk
        # server name. So we will need to process invalid