From 36da02feaf635168f08ea06471fc1bfc38ebc3d4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 3 Feb 2004 19:42:57 +0000 Subject: Tidy files, add copyright notices, add make dist target svn:r84 --- writeHTML.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'writeHTML.py') diff --git a/writeHTML.py b/writeHTML.py index d7b1ffa..543857a 100644 --- a/writeHTML.py +++ b/writeHTML.py @@ -1,4 +1,7 @@ #!/usr/bin/python2 +# Copyright 2003-2004, Nick Mathewson. See LICENSE for licensing info. + +"""Generate indices by author, topic, date, and BibTeX key.""" import sys import re @@ -18,7 +21,7 @@ def getTemplate(name): return template_s, template_e def writeBody(f, sections, section_urls): - '''f: an open file + '''f: an open file sections: list of (sectionname, [list of BibTeXEntry]) section_urls: map from sectionname to external url''' for s, entries in sections: @@ -49,15 +52,15 @@ def writeHTML(f, sections, sectionType, fieldName, choices, section_urls={}): secStr.append("

%s

\n"% ((BibTeX.url_untranslate(s),hts))) secStr = "".join(secStr) - - # + + # choiceStr = [] for choice, url in choices: if url: choiceStr.append("%s"%(url, choice)) else: choiceStr.append(choice) - + choiceStr = (" | ".join(choiceStr)) fields = { 'command_line' : "", @@ -71,7 +74,7 @@ def writeHTML(f, sections, sectionType, fieldName, choices, section_urls={}): print >>f, header%fields writeBody(f, sections, section_urls) print >>f, footer%fields - + bib = BibTeX.parseFile(config.MASTER_BIB) ##### Sorted views: -- cgit v1.2.3-70-g09d2