本文整理汇总了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))
示例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)
示例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))
示例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"))