summaryrefslogtreecommitdiffstats
path: root/utils/filters.py
blob: 2469419c21d39d6712f63bf66c5b07abfc25b46d (plain)
1
2
3
4
5
6
7
8
def filter_by_attr(objs, attr):
    return filter(lambda x: hasattr(x,attr), objs)

def filter_by_path(objs, value):
    return filter(lambda page: page.path.startswith(value), objs)

filters = [filter_by_attr, filter_by_path]