33 from python_qt_binding.QtCore
import QRegExp
34 from .base_filter
import BaseFilter
40 Contains filter logic for a message filter. If the regex flag is False 41 simple 'is this in that' text matching is used on _text. If the regex flag is True 42 _text is treated as a regular expression with one exception. If it does not 43 start with a ^ a .* is appended, and if it does not end with a $ then a .* 45 The filter_changed signal should be connected to a slot which notifies the 46 overall filtering system that it needs to reevaluate all entries. 50 super(MessageFilter, self).
__init__()
57 :param text: text to set ''str'' 58 :emits filter_changed_signal: If _enabled is true 62 self.start_emit_timer(500)
67 :param checked: boolean flag to set ''bool'' 68 :emits filter_changed_signal: If _enabled is true 72 self.start_emit_timer(500)
75 return self.
_text !=
'' 79 Tests if the message matches the filter. 80 If the regex flag is False simple 'is this in that' text matching is used 81 on _text. If the regex flag is True _text is treated as a regular expression 82 with one exception. If it does not start with a ^ a .* is appended, and if 83 it does not end with a $ then a .* is added to the end. 85 :param message: the message to be tested against the filters, ''Message'' 86 :returns: True if the message matches, ''bool'' 91 if not self.is_enabled():
100 if QRegExp(temp).exactMatch(value):
103 if value.find(self.
_text) != -1:
def set_regex(self, checked)
def test_message(self, message)
def _test_message(self, value)