[Python-checkins] peps: If form-feeds are not going to be used to indicate what can be marked as
georg.brandl
python-checkins at python.org
Wed Mar 23 21:23:29 CET 2011
http://hg.python.org/peps/rev/71bdff24635e
changeset: 50:71bdff24635e
user: Fred Drake <fdrake at acm.org>
date: Wed Jul 26 04:14:30 2000 +0000
summary:
If form-feeds are not going to be used to indicate what can be marked as
a header, use a non-white character in the first column. This looks a
little cleaner.
files:
pep2html.py | 29 ++++++++++++-----------------
1 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/pep2html.py b/pep2html.py
--- a/pep2html.py
+++ b/pep2html.py
@@ -59,40 +59,35 @@
if pep:
title = "PEP " + pep + " -- " + title
if title:
- fo.write("<title>%s</title>\n" % cgi.escape(title))
+ fo.write(" <title>%s</title>\n" % cgi.escape(title))
fo.write("</head>\n")
# body
- fo.write("<body bgcolor='white'>\n")
- fo.write("[<a href='../'>home</a>]\n")
+ fo.write('<body bgcolor="white">\n')
+ fo.write('[<a href="../">home</a>]\n')
if os.path.basename(infile) != "pep-0000.txt":
- fo.write("[<a href='.'>index</a>]\n")
- fo.write("<hr />\n<table border='0'>\n")
+ fo.write('[<a href=".">index</a>]\n')
+ fo.write('<hr />\n<table border="0">\n')
for k, v in header:
fo.write(" <tr><th align='right'>%s:</th><td>%s</td></tr>\n"
% (cgi.escape(k), cgi.escape(v)))
title = 0
- fo.write("</table>\n<pre>")
+ fo.write("</table>\n<hr />\n<pre>")
while 1:
line = fi.readline()
if not line:
break
- if line[:1] == "\f":
- fo.write("<hr />")
- # fo.write("\n</pre><hr /><pre>\n")
- title = 1
- else:
- line = fixpat.sub(lambda x, c=infile: fixanchor(c, x), line)
- if title:
+ if line[0] != "\f":
+ if line[0].strip():
if line.strip() == "Local Variables:":
break
fo.write("</pre>\n<h3>%s</h3>\n<pre>" % line.strip())
- # fo.write("</pre><h3><tt>%s</tt></h3><pre>\n" % line)
title = 0
else:
+ line = fixpat.sub(lambda x, c=infile: fixanchor(c, x), line)
fo.write(line)
- fo.write("</pre>\n")
- fo.write("</body>\n")
- fo.write("</html>\n")
+ fo.write("</pre>\n"
+ "</body>\n"
+ "</html>\n")
fo.close()
os.chmod(outfile, 0664)
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list