From: Oleg Broytman Date: Wed, 5 Dec 2007 21:05:10 +0000 (+0000) Subject: Fixed a bug - compare full dates, not only days. X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=74214a693233764fa7ff8a5e2611b923b8614aa5;p=phdru.name%2Fphdru.name.git Fixed a bug - compare full dates, not only days. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@74 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- diff --git a/reindex_blog.py b/reindex_blog.py index 7fbf9ed..1f9ead4 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -194,7 +194,7 @@ def write_template(level, year, month, day, titles, tags=None): save_titles = titles[:] titles.reverse() - save_day = None + save_date = None for year, month, day, file, title, lead in titles: href = [] if level == 0: @@ -206,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: