]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - reindex_blog.py
Fix(reindex_blog.py): More realistic examples
[phdru.name/phdru.name.git] / reindex_blog.py
index bc34887d4076fe419cde94e4f7f1de2700e11749..4a77fbf78e045611cf3f946bb04202cddefe9ba8 100755 (executable)
@@ -5,7 +5,7 @@ __author__ = "Oleg Broytman <phd@phdru.name>"
 __copyright__ = "Copyright (C) 2006-2024 PhiloSoft Design"
 
 from calendar import _localized_month
-import cgi
+from html import escape
 import locale
 import sys, os
 from urllib.parse import quote, urljoin
@@ -351,13 +351,13 @@ new_text = ["""\
      <li>��������� �������� �����������: NOT &gt; AND &gt; OR. ������ '()' ��������� ���������� ���������.</li>
 </ul>
 <p class="small">
-������� ���������: linux - �������ģ� ���������������
-�� �������� linux.html; linux&amp;!audio - ������ ������ � ������� ���� ���
-linux � ��� ���� audio; linux and not audio - �� �� �����.
+������� ���������: Linux - �������ģ� ���������������
+�� �������� Linux.html; Linux&amp;!Debian - ������ ������ � ������� ���� ���
+Linux � ��� ���� Debian; Linux and not Debian - �� �� �����.
 </p>
 
 <center>
-<form method=GET action="../../../cgi-bin/blog-ru/search-tags/search-tags.py">
+<form method=GET action="../../../cgi-bin/blog-ru/search-tags.cgi">
      <input type=text name=q>
      <input type=submit name=submit value="������">
 </form>
@@ -485,7 +485,7 @@ class AbsURLHTMLParser(_HTMLParser):
     def start_a(self, attrs):
         self.accumulator += '<a'
         for attrname, value in attrs:
-            value = cgi.escape(value, True)
+            value = escape(value, True)
             if attrname == 'href':
                 self.accumulator += ' href="%s"' % urljoin(self.base, value)
             else:
@@ -498,7 +498,7 @@ class AbsURLHTMLParser(_HTMLParser):
     def start_img(self, attrs):
         self.accumulator += '<img'
         for attrname, value in attrs:
-            value = cgi.escape(value, True)
+            value = escape(value, True)
             if attrname == 'src':
                 self.accumulator += ' src="%s"' % urljoin(self.base, value)
             else: