X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=reindex_blog.py;h=ac22002b324adc704dd42119dd5f4f4383dc2880;hb=8c0064206e738803c2251b06033d10f7cf922648;hp=33e9077aefd0e6472959c3300d1f105ea59ef6b0;hpb=b59767fc8b80d3feb32856a2aa3f6a5a10290b63;p=phdru.name%2Fphdru.name.git diff --git a/reindex_blog.py b/reindex_blog.py index 33e9077..ac22002 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -2,9 +2,10 @@ # -*- coding: koi8-r -*- __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2006-2014 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] @@ -95,14 +96,14 @@ if blog <> old_blog: import locale locale.setlocale(locale.LC_ALL, "ru_RU.KOI8-R") -from calendar import _localized_day, _localized_month +from calendar import _localized_month locale.setlocale(locale.LC_TIME, 'C') months_names_en = list(_localized_month('%B')) months_abbrs_en = list(_localized_month('%b')) locale.setlocale(locale.LC_TIME, "ru_RU.KOI8-R") -#months_names_ru = list(_localized_month('%B')) +# months_names_ru = list(_localized_month('%B')) months_names_ru = ['', "ÑÎ×ÁÒÑ", "ÆÅ×ÒÁÌÑ", "ÍÁÒÔÁ", "ÁÐÒÅÌÑ", "ÍÁÑ", "ÉÀÎÑ", "ÉÀÌÑ", "Á×ÇÕÓÔÁ", "ÓÅÎÔÑÂÒÑ", "ÏËÔÑÂÒÑ", "ÎÏÑÂÒÑ", "ÄÅËÁÂÒÑ" @@ -213,7 +214,7 @@ def write_template(level, year, month, day, titles, tags=None): href.append(file) href = '/'.join(href) if day[0] == '0': day = day[1:] - if save_date <> (year, month, day): + if save_date != (year, month, day): if level == 0: new_text.append('\n

%s %s %s

' % (day, months_names_ru[int(month)], year)) else: @@ -360,7 +361,7 @@ new_text = ["""\
  • ïÐÅÒÁÔÏÒ '!' (NOT, not) - ÉÝÅÔ ÚÁÐÉÓÉ, × ËÏÔÏÒÙÈ ÎÅÔ ÜÔÏÇÏ ÔÅÇÁ.
  • ïÐÅÒÁÔÏÒ '&' (AND, and) - ÉÝÅÔ ÚÁÐÉÓÉ, × ËÏÔÏÒÙÈ ÅÓÔØ ÏÂÁ ÔÅÇÁ.
  • ïÐÅÒÁÔÏÒ '|' (OR, or) - ÉÝÅÔ ÚÁÐÉÓÉ, × ËÏÔÏÒÙÈ ÅÓÔØ ÌÀÂÙÅ ÉÚ ÔÅÇÏ×.
  • -
  • óËÏÂËÉ '()' ÐÏÚ×ÏÌÑÀÔ ÏÂßÅÄÉÎÑÔØ ×ÙÒÁÖÅÎÉÑ.
  • +
  • ðÒÉÏÒÉÔÅÔ ÏÐÅÒÁÃÉÊ ÓÔÁÎÄÁÒÔÎÙÊ: NOT > AND > OR. óËÏÂËÉ '()' ÐÏÚ×ÏÌÑÀÔ ÏÂßÅÄÉÎÑÔØ ×ÙÒÁÖÅÎÉÑ.
  • ðÒÉÍÅÒÙ ×ÙÒÁÖÅÎÉÊ: linux - ÐÒÏÉÚÏÊÄ£Ô ÐÅÒÅÎÁÐÒÁ×ÌÅÎÉÅ