perceval/backends/core/supybot.py
def parse_supybot_log(filepath):
        """Parse a Supybot IRC log file.

        The method parses the Supybot IRC log file and returns an iterator of
        dictionaries. Each one of this, contains a message from the file.

        :param filepath: path to the IRC log file

        :returns: a generator of parsed messages

        :raises ParseError: raised when the format of the Supybot log file
            is invalid
        :raises OSError: raised when an error occurs reading the
            given file
        """
        with open(filepath, 'r', errors='surrogateescape',
                  newline=os.linesep) as f:
            parser = SupybotParser(f)

            try:
                for message in parser.parse():
                    yield message
            except ParseError as e:
                cause = "file: %s; reason: %s" % (filepath, str(e))
                raise ParseError(cause=cause)
def parse_supybot_log(filepath):
        with open(filepath, 'r', errors='surrogateescape',
                  newline=os.linesep) as f:
            parser = SupybotParser(f)

            try:
                for message in parser.parse():
                    yield message
            except ParseError as e:
                cause = "file: %s; reason: %s" % (filepath, str(e))
                raise ParseError(cause=cause)
def parse_supybot_log ( filepath ) : with open ( filepath , 'r' , errors = 'surrogateescape' , newline = os . linesep ) as f : parser = SupybotParser ( f ) try : for message in parser . parse ( ) : yield message except ParseError as e : cause = "file: %s; reason: %s" % ( filepath , str ( e ) ) raise ParseError ( cause = cause )
Parse a Supybot IRC log file.

        The method parses the Supybot IRC log file and returns an iterator of
        dictionaries. Each one of this, contains a message from the file.

        :param filepath: path to the IRC log file

        :returns: a generator of parsed messages

        :raises ParseError: raised when the format of the Supybot log file
            is invalid
        :raises OSError: raised when an error occurs reading the
            given file
Parse a Supybot IRC log file .