

def queue(self):
    while self.socket:
        if (not self.ready):
            time.sleep(0.1)
            continue
        for (i, message) in enumerate(self.msgQueue):
            for channel in self.channels:
                if (len(message) > 400):
                    for l in range(int(math.ceil((len(message) / 400.0)))):
                        chunk = message[(l * 400):((l + 1) * 400)]
                        self.send(('PRIVMSG %s :%s' % (channel, chunk)))
                else:
                    self.send(('PRIVMSG %s :%s' % (channel, message)))
            del self.msgQueue[i]
        self.msgQueue = []
        time.sleep(0.1)

dataset/ETHPy150Open benbaptist/minecraft-wrapper/src/irc.py IRC.queue/original