1 # -*- coding: utf-8; mode: python; -*-
3 # GStreamer Debug Viewer - View and analyze GStreamer debug log files
5 # Copyright (C) 2007 René Stadler <mail@renestadler.de>
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the Free
9 # Software Foundation; either version 3 of the License, or (at your option)
12 # This program is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 # You should have received a copy of the GNU General Public License along with
18 # this program. If not, see <http://www.gnu.org/licenses/>.
20 """GStreamer Debug Viewer GUI module."""
22 from GstDebugViewer.GUI.models import LogModelBase
24 class Filter (object):
28 class DebugLevelFilter (Filter):
30 def __init__ (self, debug_level):
32 col_id = LogModelBase.COL_LEVEL
33 def filter_func (row):
34 return row[col_id] != debug_level
35 self.filter_func = filter_func
37 class CategoryFilter (Filter):
39 def __init__ (self, category):
41 col_id = LogModelBase.COL_CATEGORY
42 def category_filter_func (row):
43 return row[col_id] != category
44 self.filter_func = category_filter_func
46 class ObjectFilter (Filter):
48 def __init__ (self, object_):
50 col_id = LogModelBase.COL_OBJECT
51 def object_filter_func (row):
52 return row[col_id] != object_
53 self.filter_func = object_filter_func
55 class FilenameFilter (Filter):
57 def __init__ (self, filename):
59 col_id = LogModelBase.COL_FILENAME
60 def filename_filter_func (row):
61 return row[col_id] != filename
62 self.filter_func = filename_filter_func