]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Exchanged filename and title in the blog values.
authorOleg Broytman <phd@phdru.name>
Wed, 1 Mar 2006 20:53:33 +0000 (20:53 +0000)
committerOleg Broytman <phd@phdru.name>
Wed, 1 Mar 2006 20:53:33 +0000 (20:53 +0000)
git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@10 7bb0bf08-9e0d-0410-b083-99cee3bf18b8

reindex_blog.py

index 1539849088d4eac7e4309337c7b5d70149451f66..7e39798b506783c286ce12ed7acfe74f58d57816 100755 (executable)
@@ -31,7 +31,7 @@ else:
    blog_file.close()
 
 
-# blog is a dictionary mapping (year, month, day) => (title, filename, lead)
+# blog is a dictionary mapping (year, month, day) => (filename, title, lead)
 blog = {}
 years = {}
 
@@ -49,7 +49,7 @@ for dirpath, dirs, files in os.walk(os.curdir):
 
       if title:
          year, month, day = dirpath.split(os.sep)[1:]
-         blog[year, month, day] = (title, os.path.basename(file), lead)
+         blog[year, month, day] = (os.path.basename(file), title, lead)
 
          if year in years:
             months = years[year]
@@ -241,7 +241,7 @@ for year in sorted(years.keys()):
          day_titles = []
          key = year, month, day
          if key in blog:
-            title, tmpl, lead = blog[key]
+            tmpl, title, lead = blog[key]
             if tmpl.endswith(".tmpl"): tmpl = tmpl[:-len("tmpl")] + "html"
             all_titles.append((key, tmpl, title, lead))
             year_titles.append((key, tmpl, title, lead))