From: Oleg Broytman Date: Fri, 3 Mar 2006 18:40:02 +0000 (+0000) Subject: Changed filename => file. X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=f6d66359b3843c53ba9f79e1c33b23941cf3b2c7;p=phdru.name%2Fphdru.name.git Changed filename => file. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@16 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- diff --git a/reindex_blog.py b/reindex_blog.py index 98d1181..4d0ad0a 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -31,7 +31,7 @@ else: # blog is a dictionary mapping -# (year, month, day) => [list of (filename, title, lead)] +# (year, month, day) => [list of (file, title, lead)] blog = {} years = {} @@ -184,7 +184,7 @@ def write_template(level, year, month, day, titles): titles.reverse() save_day = None - for year, month, day, filename, title, lead in titles: + for year, month, day, file, title, lead in titles: href = [] if level == 0: href.append(year) @@ -192,7 +192,7 @@ def write_template(level, year, month, day, titles): href.append(month) if level <= 2: href.append(day) - href.append(filename) + href.append(file) href = '/'.join(href) if day[0] == '0': day = day[1:] if save_day <> day: @@ -213,7 +213,7 @@ def write_template(level, year, month, day, titles): if level == 0: years = {} - for year, month, day, filename, title, lead in save_titles: + for year, month, day, file, title, lead in save_titles: years[year] = True first_year = True new_text.append(''' @@ -254,10 +254,9 @@ for year in sorted(years.keys()): day_titles = [] key = year, month, day if key in blog: - for filename, title, lead in blog[key]: - if filename.endswith(".tmpl"): - filename = filename[:-len("tmpl")] + "html" - value = (year, month, day, filename, title, lead) + for file, title, lead in blog[key]: + if file.endswith(".tmpl"): file = file[:-len("tmpl")] + "html" + value = (year, month, day, file, title, lead) all_titles.append(value) year_titles.append(value) month_titles.append(value)