]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Changed filename => file.
authorOleg Broytman <phd@phdru.name>
Fri, 3 Mar 2006 18:40:02 +0000 (18:40 +0000)
committerOleg Broytman <phd@phdru.name>
Fri, 3 Mar 2006 18:40:02 +0000 (18:40 +0000)
git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@16 7bb0bf08-9e0d-0410-b083-99cee3bf18b8

reindex_blog.py

index 98d118131ce4e70fd2e946eb64c144de42f0b476..4d0ad0a052e3b45abd34255e22c65483d28c5aab 100755 (executable)
@@ -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)