コード例 #1
0
ファイル: test_channels.py プロジェクト: sbuss/qotr
 def test_remove(self):
     Channels.create(self.channel_id, self.meta)
     self.assertEqual(1, Channels.count())
     Channels.remove(self.channel_id)
     self.assertEqual(0, Channels.count())
     Channels.remove(self.channel_id)
     self.assertEqual(0, Channels.count())
コード例 #2
0
ファイル: chat.py プロジェクト: sbuss/qotr
    def on_close(self):
        if not self.channel:
            return

        self.channel.connections -= 1

        if self.channel.has(self):
            self.channel.part(self)
            self.broadcast(Message(MT.part, sender=self))

        if self.channel.connections <= 0:
            L.debug('Deleting channel: %s', self.channel_id)
            Channels.remove(self.channel_id)
コード例 #3
0
ファイル: chat.py プロジェクト: rmoorman/qotr
    def on_close(self):
        if not self.channel:
            return

        self.channel.connections -= 1

        if self.channel.has(self):
            self.channel.part(self)
            self.broadcast(Message(MT.part, sender=self))

        if self.channel.connections <= 0:
            L.debug('Deleting channel: %s', self.channel_id)
            Channels.remove(self.channel_id)