log_line.py
changeset 50 f13cf27a360b
parent 46 185504387370
child 64 cdb6403c2498
equal deleted inserted replaced
49:aaa62c8e5bd5 50:f13cf27a360b
       
     1 """
       
     2     An IRC logfile consists of a series of lines/events
       
     3 """
       
     4 
       
     5 class LogTypes :
       
     6     """
       
     7         Definitions of the various LogLines types
       
     8     """
       
     9     
       
    10     # unknown type, may or may not have a timestamp, no source, only data
       
    11     RAW         = 0x01
       
    12 
       
    13 class LogLine (object) :
       
    14     """
       
    15         An event on some specific channel
       
    16     """
       
    17 
       
    18     # the event type, as defiend in LogTypes
       
    19     type = None
       
    20 
       
    21     # the UTC timestamp of the event
       
    22     timestamp = None
       
    23 
       
    24     # the event source
       
    25     source = None
       
    26 
       
    27     # associated data (message, etc)
       
    28     data = None
       
    29     
       
    30     def __init__ (self, type, timestamp, source, data) :
       
    31         """
       
    32             Initialize with given values
       
    33         """
       
    34 
       
    35         self.type = type
       
    36         self.timestamp = timestamp
       
    37         self.source = source
       
    38         self.data = data
       
    39