X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=reindex_blog.py;h=c2a87c603062d38d493ed1bef8031b88413ff47a;hb=331965859222bca39a7fc251cdc93830620c8a4a;hp=82cdde591b34951ef3d82a9a2bc5ff01331801a6;hpb=2df1050b44c2cfa7dabefec5af45d234e9c49dcd;p=phdru.name%2Fphdru.name.git diff --git a/reindex_blog.py b/reindex_blog.py index 82cdde5..c2a87c6 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -2,9 +2,10 @@ # -*- coding: koi8-r -*- __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2006-2013 PhiloSoft Design" +__copyright__ = "Copyright (C) 2006-2017 PhiloSoft Design" import sys, os +from Cheetah.compat import string_type blog_data_root = sys.argv[1] blog_root = sys.argv[2] @@ -54,7 +55,7 @@ for dirpath, dirs, files in os.walk(blog_root): lead = template.Lead.decode('utf-8').encode('koi8-r') tags = template.Tag - if isinstance(tags, basestring): + if isinstance(tags, string_type): tags = (tags,) tags = [tag.decode('utf-8').encode('koi8-r') for tag in tags] @@ -360,7 +361,7 @@ new_text = ["""\
  • ïÐÅÒÁÔÏÒ '!' (NOT, not) - ÉÝÅÔ ÚÁÐÉÓÉ, × ËÏÔÏÒÙÈ ÎÅÔ ÜÔÏÇÏ ÔÅÇÁ.
  • ïÐÅÒÁÔÏÒ '&' (AND, and) - ÉÝÅÔ ÚÁÐÉÓÉ, × ËÏÔÏÒÙÈ ÅÓÔØ ÏÂÁ ÔÅÇÁ.
  • ïÐÅÒÁÔÏÒ '|' (OR, or) - ÉÝÅÔ ÚÁÐÉÓÉ, × ËÏÔÏÒÙÈ ÅÓÔØ ÌÀÂÙÅ ÉÚ ÔÅÇÏ×.
  • -
  • óËÏÂËÉ '()' ÐÏÚ×ÏÌÑÀÔ ÏÂßÅÄÉÎÑÔØ ×ÙÒÁÖÅÎÉÑ.
  • +
  • ðÒÉÏÒÉÔÅÔ ÏÐÅÒÁÃÉÊ ÓÔÁÎÄÁÒÔÎÙÊ: NOT > AND > OR. óËÏÂËÉ '()' ÐÏÚ×ÏÌÑÀÔ ÏÂßÅÄÉÎÑÔØ ×ÙÒÁÖÅÎÉÑ.
  • ðÒÉÍÅÒÙ ×ÙÒÁÖÅÎÉÊ: linux - ÐÒÏÉÚÏÊÄ£Ô ÐÅÒÅÎÁÐÒÁ×ÌÅÎÉÅ @@ -375,7 +376,6 @@ linux -

    """] @@ -428,7 +428,6 @@ for i, (count, tag, links) in enumerate(all_tags): #def body_html

    %s

    -

    -

    #end def $phd_site.respond(self) """) @@ -453,7 +451,6 @@ $phd_site.respond(self) new_text.append("""\
    -

    #end def $phd_site.respond(self) """) @@ -567,7 +564,6 @@ for item in tuple(reversed(all_titles_tags))[:10]: item.categoryList = tags body = bodies[(year, month, day, file)] body = absolute_urls(body, baseURL + url_path) - body = body.decode('koi8-r').encode('utf-8') item.body = body item.excerpt = get_first_p(body)