#! /usr/bin/env python import os, stat blogsrcdir = "/public/shallowsky/blogfiles" blogdir = "/public/shallowsky/blog" tagdir = os.path.join(blogdir, "tags") # Insert the standard page header: tagindexfd = open(os.path.join(tagdir, "index.html"), "w") tagindexfd.write('''Content-type: text/html\n\n\
\n") dirs = os.listdir(tagdir) dirs.sort() lastletter = "" for nam in dirs : if stat.S_ISDIR(os.stat(os.path.join(tagdir, nam))[stat.ST_MODE]) : if nam[0] != lastletter : lastletter = nam[0] tagindexfd.write("
" + lastletter + " : ") tagindexfd.write('' + nam + ' •') # Sadly, there's no easy way to include the standard sidebar # until I figure out how to integrate this script into PyBloxsom. tagindexfd.write('