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


Python Network.sendMsg方法代码示例

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


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

示例1: sendMsg

# 需要导入模块: import Network [as 别名]
# 或者: from Network import sendMsg [as 别名]
	def sendMsg(self, to_nick, format, *args):
		#sends a message to a nick as this client
		#eventually, will use the client's preferred notification method, for now it's PRIVMSGs
		#Network.sendMsg(IRCMessage(":", self.nick, "PRIVMSG", to_nick, format % args))
		if(isinstance(format, types.StringTypes)):
			text=format % args
		else:
			text=format
		
		for line in IRCMessage.wrapText(text):
			Network.sendMsg(IRCMessage(":", self.nick, "PRIVMSG", to_nick, line))
开发者ID:BasementCat,项目名称:ffservices,代码行数:13,代码来源:Pseudoclient.py

示例2: introduce

# 需要导入模块: import Network [as 别名]
# 或者: from Network import sendMsg [as 别名]
	def introduce(self):
		svr=Server.getLinkedServer()
		msg=None
		if(svr.protoctl["NICKv2"]):
			if(svr.protoctl["CLK"]): #NICKv2 and CLK
				if(svr.protoctl["NICKIP"]): #NICKv2 and CLK and NICKIP
					msg=IRCMessage(None, None, "nick", self.nick, self.hopcount, self.timestamp, self.username, self.hostname, self.server, self.servicestamp, self.usermodes, self.virtualhost, self.cloakedhost, self.nickipaddr, self.realname)
				else: #NICKv2 and CLK
					msg=IRCMessage(None, None, "nick", self.nick, self.hopcount, self.timestamp, self.username, self.hostname, self.server, self.servicestamp, self.usermodes, self.virtualhost, self.cloakedhost, self.realname)
			else: #NICKv2 but not CLK
				if(svr.protoctl["NICKIP"]): #NICKv2 and NICKIP
					msg=IRCMessage(None, None, "nick", self.nick, self.hopcount, self.timestamp, self.username, self.hostname, self.server, self.servicestamp, self.usermodes, self.virtualhost, self.nickipaddr, self.realname)
				else: #nickv2, no clk, no nickip
					msg=IRCMessage(None, None, "nick", self.nick, self.hopcount, self.timestamp, self.username, self.hostname, self.server, self.servicestamp, self.usermodes, self.virtualhost, self.realname)
		else: #normal
			msg=IRCMessage(None, None, "nick", self.nick, self.hopcount, self.timestamp, self.username, self.hostname, self.server, self.servicestamp, self.realname)
		
		Network.sendMsg(msg)
开发者ID:BasementCat,项目名称:ffservices,代码行数:20,代码来源:Client.py

示例3: remove

# 需要导入模块: import Network [as 别名]
# 或者: from Network import sendMsg [as 别名]
	def remove(self, reason="Removed"):
		del self.pseudoclients[self.name]
		del self.pseudoclients_bynick[self.nick.lower()]
		Client.removeClient(self)
		Network.sendMsg(IRCMessage(":", self.nick, "QUIT", reason))
开发者ID:BasementCat,项目名称:ffservices,代码行数:7,代码来源:Pseudoclient.py

示例4: introduce

# 需要导入模块: import Network [as 别名]
# 或者: from Network import sendMsg [as 别名]
	def introduce(self):
		Network.sendMsg(IRCMessage(":", config.get("Server/Name"), "server", self.name, self.hopcount+1, self.description))
		Network.sendMsg(IRCMessage(":", self.name, "EOS"))
开发者ID:BasementCat,项目名称:ffservices,代码行数:5,代码来源:Server.py


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