status = "404 Tag not found"
title = "Ошибка!"
body = "Тег %s не существует!" % tag
+ else: # Process tree
+ from tags import find_tags
+ posts = find_tags(tree)
+ status = None
+ title = "Записи, найденные для выражения " + q
+ if posts:
+ _posts = ["""\
+<p class="head">
+<ul>
+"""]
+ for year, month, day, suburl, _title in posts:
+ _posts.append('<li>%s-%s-%s <a href="../../../../Russian/blog/%s">%s</a></li>\n' % (year, month, day, suburl, _title))
+ _posts .append("""\
+</ul>
+</p>
+""")
+ body = ''.join(_posts)
+ else:
+ body = "Не найдено ни одной записи."
response(title, body, status)