PEATDB/Filtering.py
def doFiltering(self, searchfunc, filters=None):
        """Filter recs by several filters using user provided search function.
        Provides a list of tuples with filter values"""
        F=[]
        for f in self.filters:
            F.append(f.getFilter())
        #print F
        sets = []
        for f in F:
            col, val, op, boolean = f
            names = searchfunc(col, val, op)
            sets.append((set(names), boolean))
        names = sets[0][0]
        for s in sets[1:]:
            b=s[1]
            if b == 'AND':
                names = names & s[0]
            elif b == 'OR':
                names = names | s[0]
            elif b == 'NOT':
                names = names - s[0]
        names = list(names)
        self.updateResults(len(names))
        return names
Filter recs by several filters using user provided search function.
        Provides a list of tuples with filter values
Filter recs by several filters using user provided search function.
Provides a list of tuples with filter values
Filter recs by several filters using user provided search function . Provides a list of tuples with filter values
def doFiltering(self, searchfunc, filters=None):
        F=[]
        for f in self.filters:
            F.append(f.getFilter())
        sets = []
        for f in F:
            col, val, op, boolean = f
            names = searchfunc(col, val, op)
            sets.append((set(names), boolean))
        names = sets[0][0]
        for s in sets[1:]:
            b=s[1]
            if b == 'AND':
                names = names & s[0]
            elif b == 'OR':
                names = names | s[0]
            elif b == 'NOT':
                names = names - s[0]
        names = list(names)
        self.updateResults(len(names))
        return names
def doFiltering ( self , searchfunc , filters = None ) : F = [ ] for f in self . filters : F . append ( f . getFilter ( ) ) sets = [ ] for f in F : col , val , op , boolean = f names = searchfunc ( col , val , op ) sets . append ( ( set ( names ) , boolean ) ) names = sets [ 0 ] [ 0 ] for s in sets [ 1 : ] : b = s [ 1 ] if b == 'AND' : names = names & s [ 0 ] elif b == 'OR' : names = names | s [ 0 ] elif b == 'NOT' : names = names - s [ 0 ] names = list ( names ) self . updateResults ( len ( names ) ) return names
Filter recs by several filters using user provided search function.
Filter recs by several filters using user provided search function .
"""Filter recs by several filters using user provided search function.
        Provides a list of tuples with filter values""" #print F
self
searchfunc
filters