irc.py
def enter_event_loop(self):
        """\
        Main loop of the IRCConnection - reads from the socket and dispatches
        based on regex matching
        """
        patterns = self.dispatch_patterns()
        self.logger.debug('entering receive loop')

        while 1:
            try:
                data = self._sock_file.readline()
            except socket.error:
                data = None

            if not data:
                self.logger.info('server closed connection')
                self.close()
                return True

            data = data.rstrip()

            for pattern, callback in patterns:
                match = pattern.match(data)
                if match:
                    callback(**match.groupdict())
def enter_event_loop(self):
        """\
        Main loop of the IRCConnection - reads from the socket and dispatches
        based on regex matching
        """
        patterns = self.dispatch_patterns()
        self.logger.debug('entering receive loop')

        while 1:
            try:
                data = self._sock_file.readline()
            except socket.error:
                data = None

            if not data:
                self.logger.info('server closed connection')
                self.close()
                return True

            data = data.rstrip()

            for pattern, callback in patterns:
                match = pattern.match(data)
                if match:
                    callback(**match.groupdict())
\
        Main loop of the IRCConnection - reads from the socket and dispatches
        based on regex matching