log_line.py
author Tero Marttila <terom@fixme.fi>
Tue, 10 Feb 2009 03:22:43 +0200
changeset 80 a0662cff1d9d
parent 64 cdb6403c2498
child 86 645cf9c4441e
permissions -rw-r--r--
add RSSFormatter, and link to different types from channel_last.tmpl...
"""
    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 offset, only garunteed to be unique for a specific channel and date
    offset = None

    # 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, offset, type, timestamp, source, data) :
        """
            Initialize with given values
        """
        
        self.offset = offset
        self.type = type
        self.timestamp = timestamp
        self.source = source
        self.data = data