log_channel.py
author Tero Marttila <terom@fixme.fi>
Mon, 09 Feb 2009 11:46:17 +0200
changeset 65 8b50694f841e
parent 46 185504387370
child 86 645cf9c4441e
permissions -rw-r--r--
improve search further
"""
    A channel represents a series of log events, stored in some log source
"""

import log_search

class LogChannel (object) :
    """
        A single IRC channel, logged to some specific place
    """

    def __init__ (self, id, network, name, source) :
        """
            Initialize this channel from the given identifier key, network name, channel name, and LogSource
        """
        
        self.id = id
        self.network = network
        self.name = name
        self.source = source
    
    @property
    def title (self) :
        """
            Title is 'Network - #channel'
        """

        return "%s - %s" % (self.network, self.name)
    
    def search (self, query) :
        """
            Perform a search on this channel, returning a sequence of LogLines
        """

        return log_search.index.search_simple(self, query)