X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=search-tags.py;h=e40f05c0500e5104d88e0948da57a7196ba85dbc;hb=3eadd8423e41b70e89854bd63e0e9875e259978c;hp=8d322d12057ed3290646c67c3c99b94846a6e877;hpb=ed552696f81f160ff233a268cbc9b506e76edce9;p=phdru.name%2Fcgi-bin%2Fblog-ru%2Fsearch-tags.git diff --git a/search-tags.py b/search-tags.py index 8d322d1..e40f05c 100755 --- a/search-tags.py +++ b/search-tags.py @@ -1,8 +1,9 @@ #! /usr/bin/env python +# coding: koi8-r """Search tags CGI""" __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2014 PhiloSoft Design" +__copyright__ = "Copyright (C) 2014-2016 PhiloSoft Design" __license__ = "GNU GPL" import cgi, sys @@ -35,7 +36,26 @@ else: redirect("/Russian/blog/tags/%s.html" % tag, status="301 Moved") sys.exit() status = "404 Tag not found" - title = "Error!" - body = "Tag does not exist!" + title = "ïÛÉÂËÁ!" + body = "ôÅÇ %s ÎÅ ÓÕÝÅÓÔ×ÕÅÔ!" % tag + else: # Process tree + from tags import find_tags + posts = find_tags(tree) + status = None + title = "úÁÐÉÓÉ, ÎÁÊÄÅÎÎÙÅ ÄÌÑ ×ÙÒÁÖÅÎÉÑ " + cgi.escape(q) + if posts: + _posts = ["""\ +

+

+

+""") + body = ''.join(_posts) + else: + body = "îÅ ÎÁÊÄÅÎÏ ÎÉ ÏÄÎÏÊ ÚÁÐÉÓÉ." response(title, body, status)