]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Fixed a bug - compare full dates, not only days.
authorOleg Broytman <phd@phdru.name>
Wed, 5 Dec 2007 21:05:10 +0000 (21:05 +0000)
committerOleg Broytman <phd@phdru.name>
Wed, 5 Dec 2007 21:05:10 +0000 (21:05 +0000)
git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@74 7bb0bf08-9e0d-0410-b083-99cee3bf18b8

reindex_blog.py

index 7fbf9ed10afaf491a90af7d7bdea71add0abdf07..1f9ead41b099f7f2b881ad08654ac1f470d7e04a 100755 (executable)
@@ -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<h2>%s %s %s</h2>' % (day, months_names_ru[int(month)], year))
          else:
             new_text.append('\n<h2>%s %s</h2>' % (day, months_names_ru[int(month)]))
-         save_day = day
+         save_date = year, month, day
       if lead:
          lead = lead + ' '
       else: