]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/commitdiff
Add docstrings
authorOleg Broytman <phd@phdru.name>
Tue, 20 May 2014 06:02:02 +0000 (10:02 +0400)
committerOleg Broytman <phd@phdru.name>
Tue, 20 May 2014 06:02:02 +0000 (10:02 +0400)
tags.py

diff --git a/tags.py b/tags.py
index df64a1c286a7e645a84239c0d6571a7af46ee89d..7bfc95ea28f04ed79e55bc7ead4af1d766a2e8b4 100644 (file)
--- a/tags.py
+++ b/tags.py
@@ -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]
@@ -44,6 +49,11 @@ def _test_post(post, tree):
         raise ValueError("Cannot get there")
 
 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: