当前位置: 首页>>代码示例>>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;未经允许,请勿转载。