def ls(roots, show_details=True): for root in roots: for path, attrs in _each(root): _print(path, rating=util.get_rating(attrs), tags=util.get_tags(attrs), comment=util.get_comment(attrs), show_details=show_details)
def ls(roots, show_details=True): for root in roots: for path, attrs in _each(root): _print( path, rating=util.get_rating(attrs), tags=util.get_tags(attrs), comment=util.get_comment(attrs), show_details=show_details)
def query(predicate, roots, show_details=True): expr = compile(predicate, '(predicate)', 'eval') for root in roots: for path, attrs in _each(root): rating = util.get_rating(attrs) tags = util.get_tags(attrs) comment = util.get_comment(attrs) show = eval(expr, { 'rating': rating, 'tags': tags, 'r':rating, 't':tags, 'comment':comment, 'c':comment, 'op':operator, }) if show: _print(path, rating=rating, tags=tags, comment=comment, show_details=show_details)
def query(predicate, roots, show_details=True): expr = compile(predicate, '(predicate)', 'eval') for root in roots: for path, attrs in _each(root): rating = util.get_rating(attrs) tags = util.get_tags(attrs) comment = util.get_comment(attrs) show = eval( expr, { 'rating': rating, 'tags': tags, 'r': rating, 't': tags, 'comment': comment, 'c': comment, 'op': operator, }) if show: _print(path, rating=rating, tags=tags, comment=comment, show_details=show_details)