Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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)