log_line.py
author Tero Marttila <terom@fixme.fi>
Mon, 09 Feb 2009 00:24:13 +0200
changeset 50 f13cf27a360b
parent 46 log_event.py@185504387370
child 64 cdb6403c2498
permissions -rw-r--r--
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
"""
    An IRC logfile consists of a series of lines/events
"""

class LogTypes :
    """
        Definitions of the various LogLines types
    """
    
    # unknown type, may or may not have a timestamp, no source, only data
    RAW         = 0x01

class LogLine (object) :
    """
        An event on some specific channel
    """

    # the event type, as defiend in LogTypes
    type = None

    # the UTC timestamp of the event
    timestamp = None

    # the event source
    source = None

    # associated data (message, etc)
    data = None
    
    def __init__ (self, type, timestamp, source, data) :
        """
            Initialize with given values
        """

        self.type = type
        self.timestamp = timestamp
        self.source = source
        self.data = data