From a111d627eb1f34a224b689bc072d455db5bf0c25 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 18 Aug 2009 20:18:10 +0000 Subject: [PATCH] 03172: Error editing event filter svn: r13066 --- src/FilterEditor/_EditFilter.py | 2 +- src/FilterEditor/_EditRule.py | 2 +- src/Filters/Rules/_Rule.py | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/FilterEditor/_EditFilter.py b/src/FilterEditor/_EditFilter.py index 2cf8bda07..a3b5af92f 100644 --- a/src/FilterEditor/_EditFilter.py +++ b/src/FilterEditor/_EditFilter.py @@ -204,7 +204,7 @@ class EditFilter(ManagedWindow.ManagedWindow): pass def update_rule(self, old_rule, new_rule): - if old_rule: + if old_rule is not None: self.filter.delete_rule(old_rule) self.filter.add_rule(new_rule) self.draw_rules() diff --git a/src/FilterEditor/_EditRule.py b/src/FilterEditor/_EditRule.py index 3126db50e..d08f20bdb 100644 --- a/src/FilterEditor/_EditRule.py +++ b/src/FilterEditor/_EditRule.py @@ -516,7 +516,7 @@ class EditRule(ManagedWindow.ManagedWindow): # If editing a rule, get the name so that we can select it later # sel_node = None - if self.active_rule: + if self.active_rule is not None: self.sel_class = self.active_rule.__class__ else: self.sel_class = None diff --git a/src/Filters/Rules/_Rule.py b/src/Filters/Rules/_Rule.py index 34aee9c99..3e79e6b5a 100644 --- a/src/Filters/Rules/_Rule.py +++ b/src/Filters/Rules/_Rule.py @@ -69,8 +69,6 @@ class Rule(object): def apply(self, db, person): return True - __nonzero__ = apply - def display_values(self): v = ( '%s="%s"' % ((_(self.labels[ix]),)*2) for ix in xrange(len(self.list)) if self.list[ix] )