code optimization of eventbase filters
svn: r12668
This commit is contained in:
parent
38876a32a5
commit
f4e0a45fad
@ -56,7 +56,8 @@ class HasEventBase(Rule):
|
|||||||
def prepare(self, db):
|
def prepare(self, db):
|
||||||
self.date = None
|
self.date = None
|
||||||
if self.list[0]:
|
if self.list[0]:
|
||||||
self.etype = self.list[0]
|
self.etype = EventType()
|
||||||
|
self.etype.set_from_xml_str(self.list[0])
|
||||||
else:
|
else:
|
||||||
self.etype = None
|
self.etype = None
|
||||||
try:
|
try:
|
||||||
@ -66,9 +67,7 @@ class HasEventBase(Rule):
|
|||||||
|
|
||||||
def apply(self, db, event):
|
def apply(self, db, event):
|
||||||
if self.etype:
|
if self.etype:
|
||||||
specified_type = EventType()
|
if event.type != self.etype:
|
||||||
specified_type.set_from_xml_str(self.etype)
|
|
||||||
if event.type != specified_type:
|
|
||||||
return False
|
return False
|
||||||
if self.list[3] and event.get_description().upper().find(
|
if self.list[3] and event.get_description().upper().find(
|
||||||
self.list[3].upper())==-1:
|
self.list[3].upper())==-1:
|
||||||
|
Loading…
Reference in New Issue
Block a user