X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=reindex_blog.py;h=92a02272ea79c60a9f79b0ae21fe8733d6fa47f2;hb=d840806118bfcdfa393cf53f8b9406d2246f5d6e;hp=f6505421239d531233636126b7f9ad1a91da68cb;hpb=c16fedde035dea3d7e94ea3389d2de54d095cea1;p=phdru.name%2Fphdru.name.git
diff --git a/reindex_blog.py b/reindex_blog.py
index f650542..92a0227 100755
--- a/reindex_blog.py
+++ b/reindex_blog.py
@@ -1,17 +1,18 @@
-#! /usr/local/bin/python -O
+#! /usr/bin/env python
# -*- coding: koi8-r -*-
__version__ = "$Revision$"[11:-2]
__revision__ = "$Id$"[5:-2]
__date__ = "$Date$"[7:-2]
-__author__ = "Oleg BroytMann öÕÒÎÁÌ
+öÕÒÎÁÌ
""" % {"cyear": year or 2005})
elif level == 1:
new_text.append("""\
-#attr $Title = "Oleg BroytMann's blog: %(year)s"
-#attr $Description = "BroytMann Russian Blog %(year)s Index Document"
+#attr $Title = "Oleg Broytman's blog: %(year)s"
+#attr $Description = "Broytman Russian Blog %(year)s Index Document"
#attr $Copyright = %(cyear)s
##
#def body_html
-öÕÒÎÁÌ: %(year)s
+öÕÒÎÁÌ: %(year)s
""" % {"year": year, "cyear": year or 2005})
elif level == 2:
imonth = int(month)
new_text.append("""\
-#attr $Title = "Oleg BroytMann's blog: %(month_abbr_en)s %(year)s"
-#attr $Description = "BroytMann Russian Blog %(month_name_en)s %(year)s Index Document"
+#attr $Title = "Oleg Broytman's blog: %(month_abbr_en)s %(year)s"
+#attr $Description = "Broytman Russian Blog %(month_name_en)s %(year)s Index Document"
#attr $Copyright = %(cyear)s
##
#def body_html
-öÕÒÎÁÌ: %(month_name_ru0)s %(year)s
+öÕÒÎÁÌ: %(month_name_ru0)s %(year)s
""" % {
"year": year, "cyear": year or 2005,
"month_abbr_en": months_abbrs_en[imonth], "month_name_en": months_names_en[imonth],
@@ -175,23 +178,23 @@ def write_template(level, year, month, day, titles, tags=None):
""" % titles[0][3])
new_text.append("""\
-#attr $Title = "Oleg BroytMann's blog: %(day)d %(month_abbr_en)s %(year)s"
-#attr $Description = "BroytMann Russian Blog %(day)d %(month_name_en)s %(year)s Index Document"
+#attr $Title = "Oleg Broytman's blog: %(day)d %(month_abbr_en)s %(year)s"
+#attr $Description = "Broytman Russian Blog %(day)d %(month_name_en)s %(year)s Index Document"
#attr $Copyright = %(cyear)s
##
#def body_html
-öÕÒÎÁÌ: %(day)d %(month_name_ru0)s %(year)s
+öÕÒÎÁÌ: %(day)d %(month_name_ru)s %(year)s
""" % {
"year": year, "cyear": year or 2005,
"month_abbr_en": months_abbrs_en[imonth], "month_name_en": months_names_en[imonth],
- "month_name_ru0": months_names_ru0[imonth],
+ "month_name_ru": months_names_ru[imonth],
"day": iday
})
save_titles = titles[:]
titles.reverse()
- save_day = None
+ save_date = None
for year, month, day, file, title, lead in titles:
href = []
if level == 0:
@@ -203,12 +206,12 @@ 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_day <> 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:
new_text.append('\n%s %s
' % (day, months_names_ru[int(month)]))
- save_day = day
+ save_date = year, month, day
if lead:
lead = lead + ' '
else:
@@ -246,11 +249,14 @@ def write_template(level, year, month, day, titles, tags=None):
ðÏ ÇÏÄÁÍ: ''') first_year = True - for year in sorted(years.keys()): + for year in years: if first_year: first_year = False else: @@ -260,6 +266,11 @@ def write_template(level, year, month, day, titles, tags=None):
''') + new_text.append(""" +öö +""") + new_text.append("""\ #end def $phd_pp_ru.respond(self) @@ -317,12 +328,12 @@ new_text = ["""\ ## THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. #extends phd_pp_ru #implements respond -#attr $Title = "Oleg BroytMann's blog: tags" -#attr $Description = "BroytMann Russian Blog Tags Index Document" +#attr $Title = "Oleg Broytman's blog: tags" +#attr $Description = "Broytman Russian Blog Tags Index Document" #attr $Copyright = 2006 ## #def body_html -