當前位置: 首頁>>代碼示例>>Python>>正文


Python JabberClient.__init__方法代碼示例

本文整理匯總了Python中pyxmpp.jabber.client.JabberClient.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python JabberClient.__init__方法的具體用法?Python JabberClient.__init__怎麽用?Python JabberClient.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyxmpp.jabber.client.JabberClient的用法示例。


在下文中一共展示了JabberClient.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
 def __init__(self, jid, password, obj):
     if not jid.resource:
         jid = JID(jid.node, jid.domain, "JabberRTC")
     tls = TLSSettings(require = True, verify_peer = False)
     auth = ['sasl:PLAIN']
     JabberClient.__init__(self, jid, password, tls_settings = tls, auth_methods = auth)
     self._rtobj = obj
開發者ID:yosuke,項目名稱:OpenHRIWeb,代碼行數:9,代碼來源:JabberRTC.py

示例2: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, *args, **kwargs):
        IRCInterface.__init__(self, *args, **kwargs)

        self.jid = JID(self.get_config('jid'))
        password = self.get_config('pw')

        #: If bare JID is provided add a resource -- it is required
        if not self.jid.resource:
            self.jid = JID(self.jid.node, self.jid.domain, "pyLoad")

        if self.get_config('tls'):
            tls_settings = streamtls.TLSSettings(require=True, verify_peer=False)
            auth = ("sasl:PLAIN", "sasl:DIGEST-MD5")
        else:
            tls_settings = None
            auth = ("sasl:DIGEST-MD5", "digest")

        #: Setup client with provided connection information
        #: And identity data
        JabberClient.__init__(self, self.jid, password,
                              disco_name="pyLoad XMPP Client", disco_type="bot",
                              tls_settings=tls_settings, auth_methods=auth)

        self.interface_providers = [
            VersionHandler(self),
            self,
        ]
開發者ID:OpenMediaVault-Plugin-Developers,項目名稱:openmediavault-pyload,代碼行數:29,代碼來源:XMPPInterface.py

示例3: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid, password, resource='Bot', tls_cacerts=None, server=None, port=5222):
        # if bare JID is provided add a resource -- it is required
        if isinstance(jid, basestring):
            jid = JID(jid)
        if not jid.resource:
            jid=JID(jid.node, jid.domain, resource)
        self.jid = jid
        server = server or jid.domain

        if tls_cacerts:
            if tls_cacerts == 'tls_noverify':
                tls_settings = TLSSettings(require = True, verify_peer = False)
            else:
                tls_settings = TLSSettings(require = True, cacert_file = tls_cacerts)
        else:
            tls_settings = None

        # setup client with provided connection information
        # and identity data
        JabberClient.__init__(self, jid, password,
                disco_name="PyXMPP example: echo bot", disco_type="bot",
                server=None, port=None,
                tls_settings=tls_settings)

        # add the separate components
        self.interface_providers = self.get_plugins()
        self.loop_tasks = self.get_loop_tasks()
開發者ID:Apkawa,項目名稱:nyasha,代碼行數:29,代碼來源:core.py

示例4: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid, password, server, port=5222, channel=None, tls_cacerts=None, listener=None):
        self._jid = jid
        self._server = server
        self._port = port
        self._channel = channel
        self._listener = listener
        # if bare JID is provided add a resource -- it is required
        if not self._jid.resource:
            self._jid=JID(self._jid.node, self._jid.domain, "Echobot")

        if tls_cacerts:
            if tls_cacerts == 'tls_noverify':
                tls_settings = TLSSettings(require = True, verify_peer = False)
            else:
                tls_settings = TLSSettings(require = True, cacert_file = tls_cacerts)
        else:
            tls_settings = None
            
        # setup client with provided connection information
        # and identity data
        JabberClient.__init__(self, jid=self._jid, password=password, disco_name="Datenverarbeitungseinheit Z45", disco_type="z45", tls_settings=tls_settings)
        '''
        JabberClient.__init__(self, jid, password,
                disco_name="Datenverarbeitungseinheit Z45", disco_type="z45",
                tls_settings = tls_settings)
        '''

        # add the separate components
        self.interface_providers = [
            VersionHandler(self),
            EchoHandler(self),
            ]
開發者ID:s0x,項目名稱:Z45,代碼行數:34,代碼來源:xmpp_connection.py

示例5: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
     def __init__(self, jid, password):
         if not jid.resource:
             jid=JID(jid.node, jid.domain, "WeiboNotifyRobot")
 
         tls_settings = TLSSettings(require = True, verify_peer = False)
 
         JabberClient.__init__(self, jid, password,
                 disco_name="Weibo Notify Robot", disco_type="bot",
                 tls_settings = tls_settings, auth_methods=("sasl:PLAIN",))
開發者ID:squarezhou,項目名稱:weibo-notify,代碼行數:11,代碼來源:notify.py

示例6: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, server_jid):
        jid = JID("dummy", server_jid.domain, "GetCert")

        tls_settings = TLSSettings(require = True, verify_peer = False)

        # setup client with provided connection information
        # and identity data
        JabberClient.__init__(self, jid, "",
                disco_name="PyXMPP example: getcert.py", disco_type="bot",
                tls_settings = tls_settings)
開發者ID:AdamPrzybyla,項目名稱:pyxmpp,代碼行數:12,代碼來源:getcert.py

示例7: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid, password):
        if not jid.resource:
            jid=JID(jid.node, jid.domain, "Bot")

        tls_settings = TLSSettings(require = True, verify_peer = False)

        JabberClient.__init__(self, jid, password, auth_methods=['sasl:PLAIN'],
                disco_name="Pythoner Club", disco_type="bot",
                tls_settings = tls_settings)
        self.interface_providers = [
            DaemonHandler(self),
        ]
開發者ID:cuimuxi,項目名稱:gtalkbot,代碼行數:14,代碼來源:run.py

示例8: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self,jid,password,ini):
        if not jid.resource:
            jid=JID(jid.node,jid.domain,"rbot")

        if ini:
            self.ini=ini

        tls=TLSSettings(require=True,verify_peer=False)
        auth=['sasl:PLAIN']

        JabberClient.__init__(self,jid,password,disco_name='rbot',disco_type='bot',tls_settings=tls,auth_methods=auth)
        self.interface_providers=[VersionHandler(self),EchoHandler(self,ini),]
開發者ID:blueicesir,項目名稱:utils,代碼行數:14,代碼來源:gtalk.py

示例9: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid, password):

        # if bare JID is provided add a resource -- it is required
        if not jid.resource:
            jid=JID(jid.node, jid.domain, "Logger")

        # setup client with provided connection information
        # and identity data
        JabberClient.__init__(self, jid, password,
                disco_name="PyXMPP Archiver bot", disco_type="bot")

        # register features to be announced via Service Discovery
        self.disco_info.add_feature("jabber:iq:version")
開發者ID:pontus,項目名稱:jabber-logger,代碼行數:15,代碼來源:jabber-logger.py

示例10: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid, password):
        if not jid.resource:
            jid=JID(jid.node, jid.domain, "WeiboNotifyRobot")

        tls_settings = TLSSettings(require = True, verify_peer = False)

        JabberClient.__init__(self, jid, password,
                disco_name="Weibo Notify Robot", disco_type="bot",
                tls_settings = tls_settings, auth_methods=("sasl:PLAIN",))

        # add the separate components
        self.interface_providers = [
            CommandHandler(self),
            ]
開發者ID:squarezhou,項目名稱:weibo-notify,代碼行數:16,代碼來源:robot.py

示例11: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid, passwd,to_jid, message_list):
        """message_list is a list of tuples of strings, each tuple is a 
        sentence and it's expected reply

        """
        self.messages = message_list
        self.to_jid = JID(to_jid)
        jid_ = JID(jid)
        self.fail_count = 0
        if not jid_.resource:
            jid_ = JID(jid_.node, jid_.domain, "Mibot")
        JabberClient.__init__(self, jid_, passwd)
        self.send_next = True
        self.failed_messages = []
開發者ID:dgsuarez,項目名稱:jabbs,代碼行數:16,代碼來源:clienttester.py

示例12: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, config):
        self.config = config
        self.connection = CONNECTION.idle
        self.running = True
        
        self.jid = JID("%[email protected]%s/%s" % (config.register, config.domain, config.register))
        log("register: jid:%s" % (self.jid.as_utf8(),))
        
        tls = streamtls.TLSSettings(require=True, verify_peer=False)
        auth = [ 'digest' ]

        JabberClient.__init__(self, self.jid, self.config.secret,
            disco_name="Vipadia Skype Gateway Register", disco_type="bot",
            tls_settings=tls, auth_methods=auth)
開發者ID:mor1,項目名稱:karaka,代碼行數:16,代碼來源:register.py

示例13: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid = None, password = None):
        super(Client, self).__init__()

        if None != jid and None != password:
            # if bare JID is provided add a resource
            if not jid.resource:
                jid = JID(jid.node, jid.domain, "XMPPMote")

            JabberClient.__init__(self, jid, password,
                disco_name = "XMPPMote", disco_type = "bot",
                tls_settings = None)

            self.interface_providers = [
                VersionHandler(),
                configuration.commands.get_command_handler(),
            ]
開發者ID:nthorne,項目名稱:xmppmote,代碼行數:18,代碼來源:client.py

示例14: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, jid, password):
        if not jid.resource:
            jid = JID(jid.node, jid.domain, "Bot")

            tls_settings = TLSSettings(require=True, verify_peer=False)

        JabberClient.__init__(
            self,
            jid,
            password,
            auth_methods=["sasl:PLAIN"],
            disco_name="Pythoner Club",
            disco_type="bot",
            tls_settings=tls_settings,
        )

        # add the separate components
        self.interface_providers = [VersionHandler(self), BotHandler(self)]
開發者ID:cuimuxi,項目名稱:gtalkbot,代碼行數:20,代碼來源:bot.py

示例15: __init__

# 需要導入模塊: from pyxmpp.jabber.client import JabberClient [as 別名]
# 或者: from pyxmpp.jabber.client.JabberClient import __init__ [as 別名]
    def __init__(self, **args):
        self.isconnected = False

        # Create a unique jabber resource
        resource = args.get('resource') or 'python_client'
        resource += '_' + gethostname() + ':' + str(os.getpid()) + '_' + \
            threading.currentThread().getName().lower()
        self.jid = JID(args['username'], args['host'], resource)

        osrf.log.log_debug("initializing network with JID %s and host=%s, "
            "port=%s, username=%s" % (self.jid.as_utf8(), args['host'], \
            args['port'], args['username']))

        #initialize the superclass
        JabberClient.__init__(self, self.jid, args['password'], args['host'])
        self.queue = []

        self.receive_callback = None
        self.transport_error_msg = None
開發者ID:StephenGWills,項目名稱:OpenSRF,代碼行數:21,代碼來源:net.py


注:本文中的pyxmpp.jabber.client.JabberClient.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。