DBRTools - Filtering Logic fix for doing both include and exclude. This should be a bit better.
--- a/dbrtools/dbr/dbrfilter.py Mon Apr 19 22:50:19 2010 +0100
+++ b/dbrtools/dbr/dbrfilter.py Wed Apr 21 22:28:52 2010 +0100
@@ -147,20 +147,23 @@
self.exc.add(filter)
def include(self, results):
- res = dbrresults.DBRResults(set(),set(),set(),set(),set())
if self.inc:
+ res = dbrresults.DBRResults(set(),set(),set(),set(),set())
for filter in self.inc:
- res |= filter.include(results)
+ res |= filter.include(results)
+ else:
+ res = results
return res
def exclude(self, results):
- res = results
+ res = dbrresults.DBRResults(set(),set(),set(),set(),set())
if self.exc:
+ res = results
for filter in self.exc:
res &= filter.exclude(results)
return res
def filter(self, results):
- return self.include(results) | self.exclude(results)
+ return self.include(results) & self.exclude(results)
\ No newline at end of file