Add base class for filtered log models

This commit is contained in:
René Stadler 2007-11-30 15:47:51 +02:00 committed by Stefan Sauer
parent 334a3758fb
commit 77de714d35

View file

@ -358,7 +358,7 @@ class LazyLogModel (LogModelBase):
self.line_cache[line_offset] = Data.LogLine.parse_full (line) self.line_cache[line_offset] = Data.LogLine.parse_full (line)
class FilteredLogModel (LogModelBase): class FilteredLogModelBase (LogModelBase):
def __init__ (self, super_model): def __init__ (self, super_model):
@ -368,6 +368,21 @@ class FilteredLogModel (LogModelBase):
self.access_offset = super_model.access_offset self.access_offset = super_model.access_offset
self.ensure_cached = super_model.ensure_cached self.ensure_cached = super_model.ensure_cached
self.line_cache = super_model.line_cache self.line_cache = super_model.line_cache
def line_index_to_super (self, line_index):
raise NotImplementedError ("index conversion not supported")
def line_index_from_super (self, super_line_index):
raise NotImplementedError ("index conversion not supported")
class FilteredLogModel (FilteredLogModelBase):
def __init__ (self, super_model):
FilteredLogModelBase.__init__ (self, super_model)
self.reset () self.reset ()
def reset (self): def reset (self):
@ -385,14 +400,18 @@ class FilteredLogModel (LogModelBase):
self.line_offsets[:] = (offset for row, offset in enum self.line_offsets[:] = (offset for row, offset in enum
if func (row)) if func (row))
def line_index_to_super (self, line_index):
return line_index # FIXME
def line_index_from_super (self, super_line_index): def line_index_from_super (self, super_line_index):
# FIXME
return super_line_index return super_line_index
def line_index_to_super (self, line_index):
# FIXME
return line_index
class Filter (object): class Filter (object):
pass pass