]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/blobdiff - tags.py
Fix paths
[phdru.name/cgi-bin/blog-ru/search-tags.git] / tags.py
diff --git a/tags.py b/tags.py
index 35c4634ca53702fe4791bc70237fe13aa6018a2b..d8a14f497b7e18a76bc96b3df7a9be2a978d4c33 100644 (file)
--- a/tags.py
+++ b/tags.py
@@ -6,7 +6,7 @@ except ImportError:
    import pickle
 
 try:
-   blog_file = open(blog_filename, "rb")
+   blog_file = open('../../../../phdru.name/ru/' + blog_filename, "rb")
 except IOError:
    blog_dict = {}
 else:
@@ -25,6 +25,11 @@ def tag_exists(tag):
     return False
 
 def _test_post(post, tree):
+    """Test if the list of tags in the post satisfies condition
+
+    Recursively evaluate the tree against the list of tags in the post.
+
+    """
     op = tree[0]
     if op == 'NAME':
         tag = tree[1]
@@ -43,7 +48,12 @@ def _test_post(post, tree):
     else:
         raise ValueError("Cannot get there")
 
-def calc_tree(tree):
+def find_tags(tree):
+    """Test every blog post against parsed expression
+
+    Return all posts that passed the test.
+
+    """
     _posts = []
     for (year, month, day), posts in blog_dict.iteritems():
         for post in posts: