当前位置: 首页>>代码示例>>Python>>正文


Python IRCClient.connectionMade方法代码示例

本文整理汇总了Python中twisted.words.protocols.irc.IRCClient.connectionMade方法的典型用法代码示例。如果您正苦于以下问题:Python IRCClient.connectionMade方法的具体用法?Python IRCClient.connectionMade怎么用?Python IRCClient.connectionMade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.words.protocols.irc.IRCClient的用法示例。


在下文中一共展示了IRCClient.connectionMade方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
 def connectionMade(self):
     """This function assumes that the factory was added to this
     object by the calling script.  It may be more desirable to
     implement this as an argument to the __init__"""
     self.nickname = self.factory.nickname
     self.password = self.factory.password
     IRCClient.connectionMade(self)
开发者ID:cryogen,项目名称:yardbird,代码行数:9,代码来源:bot.py

示例2: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
    def connectionMade(self):
        with open(strftime('%B %d, %Y.txt'), 'a') as log1:
            log1.write(strftime('\
[%H:%M:%S] ') + 'Connecting...' + '\n')
        print strftime('[%H:%M:%S on %B %d, %Y] ') + 'Connecting...'
        self.sendLine('CAP REQ :sasl')
        self.deferred = Deferred()
        IRCClient.connectionMade(self)
开发者ID:nosklo,项目名称:Contrl,代码行数:10,代码来源:Contrls.py

示例3: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
 def connectionMade(self):
     IRCClient.connectionMade(self)
     for chan in self.getChannels():
         filename = getLogFilename(self.factory.server, chan)
         logger = MessageLogger(filename)
         self.loggers.update({chan: logger})
         logger.log("[connected at %s]" %
             time.asctime(time.localtime(time.time())))
开发者ID:oubiwann,项目名称:bot-prakasha-ke,代码行数:10,代码来源:logger.py

示例4: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
    def connectionMade(self):
        self.nickname = self.factory.nick
        self.password = self.factory.password
        self.talkre = re.compile('^%s[>:,] (.*)$' % self.nickname)

        self.executionLock = threading.Semaphore()
        self.pingSelfId = None

        IRCClient.connectionMade(self)
开发者ID:AlanBell,项目名称:Supybot-plugins,代码行数:11,代码来源:fschfsch.py

示例5: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
	def connectionMade(self):
		IRCClient.connectionMade(self)
		self._names = {}
		self._banlist = {}
		self._exceptlist = {}
		self._invitelist = {}
		# TODO: I think this should be on "signedOn()" just in case part of the signon is causing instant disconnect
		# reset connection factory delay:
		self.factory.resetDelay()
开发者ID:ckx,项目名称:pyBurlyBot,代码行数:11,代码来源:client.py

示例6: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
    def connectionMade(self):
        print "Connection made", self.transport
        self.factory.connection = self
        IRCClient.connectionMade(self)

        if self.factory.queued:
            for channel, message in self.factory.queued:
                self.send(channel, message)
        self.factory.queued = []
        self.userData = {}
开发者ID:oubiwann,项目名称:bot-prakasha-ke,代码行数:12,代码来源:publisher.py

示例7: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
    def connectionMade(self):
        """called when a connection is initiated."""

        self.nickname = self.factory.config.nickname
        self.password = None if (self.factory.config.srv_pass=='') else self.factory.config.srv_pass
        self.versionName = self.factory.config.versionName
        self.versionNum = self.factory.config.versionNum
        self.realname = self.versionName
        self.username = self.versionName
        self.userinfo = "%s v%s" % (self.versionName, self.versionNum)
        self.pingSelfId = None
        self.initPlugins()
        IRCClient.connectionMade(self)
开发者ID:Daroth,项目名称:fatbotslim,代码行数:15,代码来源:ircbot.py

示例8: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
    def connectionMade(self):
        with open(strftime("%B %d, %Y.txt"), "a") as log1:
            log1.write(
                strftime(
                    "\
[%H:%M:%S] "
                )
                + "Connecting..."
                + "\n"
            )
        print strftime("[%H:%M:%S on %B %d, %Y] ") + "Connecting..."
        self.deferred = Deferred()
        IRCClient.connectionMade(self)
开发者ID:nosklo,项目名称:Contrl,代码行数:15,代码来源:Contrl.py

示例9: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
    def connectionMade(self):
        """Handler for post-connection event.

        Send all queued messages.
        """
        logger.info(u"connection made to %s", self.transport)
        self.factory.connection = self
        # Twisted still uses old-style classes, 10 years later. Sigh.
        IRCClient.connectionMade(self)

        while self.factory.queue:
            channel, message = self.factory.queue.popleft()
            self.send(channel, message)
开发者ID:rbarrois,项目名称:Kaoz,代码行数:15,代码来源:publishbot.py

示例10: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
	def connectionMade(self):
		IRCClient.connectionMade(self)
		self.shet = ShetClient()
		self.shet.install()
		self.shet.root = self.root
		
		# Channel monitoring actions
		self.on_action = self.shet.add_event("on_action")
		self.on_say = self.shet.add_event("on_say")
		self.on_join = self.shet.add_event("on_join")
		self.on_quit = self.shet.add_event("on_quit")
		
		# This bot can be controlled over SHET
		self.shet.add_action(self.bot_path + "say", self.shet_say)
		self.shet.add_action(self.bot_path + "say_to", self.shet_say_to)
		self.shet.add_action(self.bot_path + "action", self.shet_describe)
		self.shet.add_action(self.bot_path + "pm", self.shet_pm)
		self.shet.add_action(self.bot_path + "pm_action", self.shet_pm_describe)
		
		# Can listen to bot's PMs
		self.on_bot_pm = self.shet.add_event(self.bot_path + "on_pm")
		self.on_bot_pm_action = self.shet.add_event(self.bot_path + "on_pm_action")
		
		# User monitoring/contacting
		for user in self.user_paths:
			path = self.user_paths[user]
			user_events = {}
			self.user_events[user] = user_events
			
			# Ways to contact the user (via the bot)
			self.shet.add_action(path + "bot_say_to", self.get_say_to_fn(user))
			self.shet.add_action(path + "bot_pm_to", self.get_pm_to_fn(user))
			
			# User's channel events
			user_events["on_join"] = self.shet.add_event(path + "on_join")
			user_events["on_quit"] = self.shet.add_event(path + "on_quit")
			user_events["on_say"] = self.shet.add_event(path + "on_say")
			user_events["on_action"] = self.shet.add_event(path + "on_action")
			
			# Events other can people trigger related to the user
			user_events["on_mention"] = self.shet.add_event(path + "on_mention")
			user_events["on_address"] = self.shet.add_event(path + "on_address")
			
			# User interractions with the bot
			user_events["on_mention_bot"] = self.shet.add_event(path + "on_mention_bot")
			user_events["on_address_bot"] = self.shet.add_event(path + "on_address_bot")
			user_events["on_pm_bot"] = self.shet.add_event(path + "on_pm_bot")
			user_events["on_pm_action_bot"] = self.shet.add_event(path + "on_pm_action_bot")
开发者ID:18sg,项目名称:SHETBot,代码行数:50,代码来源:irc.py

示例11: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
 def connectionMade(self):
     IRCClient.connectionMade(self)
     echo('IRC: Connected')
开发者ID:spicerack,项目名称:sage,代码行数:5,代码来源:client.py

示例12: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
 def connectionMade(self):
     self.sendLine('CAP REQ :sasl')
     self.deferred = Deferred()
     IRCClient.connectionMade(self)
开发者ID:AchillesA,项目名称:txsocksx,代码行数:6,代码来源:tor-irc.py

示例13: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
 def connectionMade( self ):
     IRCClient.connectionMade( self )
     log.info( " Bot connection made")
开发者ID:m1ch,项目名称:ircLoad,代码行数:5,代码来源:xdccLoad.py

示例14: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
 def connectionMade(self):
     self.connected = True
     IRCClient.connectionMade(self)
     nick = yield self.config.get("nick", "ServrheV4")
     self.register(nick.encode("utf8"))
     self.dispatch("connected")
开发者ID:lae,项目名称:Servrhe,代码行数:8,代码来源:irc.py

示例15: connectionMade

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionMade [as 别名]
 def connectionMade(self):
     self.nickname = self.factory.nickname
     IRCClient.connectionMade(self)
     self.factory.connection = self
开发者ID:fullcounter,项目名称:txoffer,代码行数:6,代码来源:txoffer.py


注:本文中的twisted.words.protocols.irc.IRCClient.connectionMade方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。