]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/commitdiff
Feat(Python3): Use `mycgi`
authorOleg Broytman <phd@phdru.name>
Sat, 15 Jun 2024 23:10:58 +0000 (02:10 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 15 Jun 2024 23:10:58 +0000 (02:10 +0300)
requirements.txt [new file with mode: 0644]
search-tags.py

diff --git a/requirements.txt b/requirements.txt
new file mode 100644 (file)
index 0000000..913a44d
--- /dev/null
@@ -0,0 +1,3 @@
+Cheetah3
+lark
+mycgi
index a844960b2f4601016de12085a5b0d4cc9c82790a..fec3705e91fa0a710cd8b687f8e14cf8a5edfd5f 100755 (executable)
@@ -6,15 +6,15 @@ __author__ = "Oleg Broytman <phd@phdru.name>"
 __copyright__ = "Copyright (C) 2014-2024 PhiloSoft Design"
 __license__ = "GNU GPL"
 
-import cgi
 import sys
 
 from lark import ParseError
+import mycgi
 
 from html.response import redirect, response
 from parser import parser
 
-form = cgi.FieldStorage()
+form = mycgi.Form()
 if 'q' not in form:
     status = "400 Bad request"
     title = "Error!"
@@ -44,7 +44,7 @@ else:
             from tags import find_tags
             posts = find_tags(tree)
             status = None
-            title = "Записи, найденные для выражения " + cgi.escape(q)
+            title = "Записи, найденные для выражения " + mycgi.escape(q)
             if posts:
                 _posts = ["""\
     <p class="head">