X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=tags.py;h=44f1a070d02b08c02e9b1f265ba9ec8095bd5fb5;hb=fedd68ad8ee4b3a7115df429e1f0c2d99e3885f8;hp=d8a14f497b7e18a76bc96b3df7a9be2a978d4c33;hpb=2048bdab9fd223397272450758514bc962e8eb30;p=phdru.name%2Fcgi-bin%2Fblog-ru%2Fsearch-tags.git diff --git a/tags.py b/tags.py index d8a14f4..44f1a07 100644 --- a/tags.py +++ b/tags.py @@ -45,6 +45,8 @@ def _test_post(post, tree): return value1 or value2 elif op == 'NOT': return not _test_post(post, tree[1]) + elif op == 'PARENS': + return _test_post(post, tree[1]) else: raise ValueError("Cannot get there") @@ -59,7 +61,8 @@ def find_tags(tree): for post in posts: if _test_post(post, tree): _posts.append(( - '/'.join((year, month, day, post[0].replace('.tmpl', '.html'))), + year, month, day, + '/'.join((year, month, day, post[0][:-len("tmpl")] + "html")), post[1])) - _posts.sort() + _posts.sort(reverse=True) return _posts