class FlattenByTagMatcher(object): def __init__(self, flatten): if not is_list_like(flatten): flatten = [flatten] patterns = [p[4:] for p in flatten if p[:4].lower() == 'tag:'] self._matcher = TagPatterns(patterns) def match(self, kwtags): return self._matcher.match(kwtags) def __nonzero__(self): return bool(self._matcher)
def __init__(self, flatten): if not is_list_like(flatten): flatten = [flatten] patterns = [p[4:] for p in flatten if p[:4].lower() == 'tag:'] self._matcher = TagPatterns(patterns)