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


Python Channel.add_member方法代碼示例

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


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

示例1: go

# 需要導入模塊: from channel import Channel [as 別名]
# 或者: from channel.Channel import add_member [as 別名]
    def go(self, line):
        client = line.source
        channel = line.args[0]

        new = False

        if channel in self.parent.channels:
            channel = self.parent.channels[line.args[0]]

        else: # New channel
            channel = Channel(line.args[0], client)
            print "making new channel", line.args[0]
            self.parent.channels[channel.name] = channel
            new = True

        if channel.check_banned(client):
            client.send_line_from_server("YOUREBANNED %s :Banned from %s (%s)" %\
                    (channel.name, channel.name, "Ban set on you :("))
            return

        for uid, member in channel.clients.iteritems():
            if not client.orthogonal(member.client) and member.client.local:
                member.client.send_line_from_server(client.gen_CLIENT())

        channel.add_member(client)
        channel.burst_client(client)

        if new:
            channel.clients[client.uid].status = CHFL_CHANOP
            channel.properties = PROP_INTERNAL | PROP_TOPICREST

            for server in self.parent.serverlinks:
                channel.burst_TS6(server)

        else:
            channel.sendto_members(":%s JOIN %s" %\
                    (client.uid, channel.name), local=True)

            self.parent.sendto_servers(":%s JOIN %s %s +" %\
                    (client.uid, channel.ts, channel.name))
開發者ID:Xe,項目名稱:code,代碼行數:42,代碼來源:join.py


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